1
0
Files
Toak/_toak

68 lines
2.1 KiB
Plaintext

#compdef toak
_toak() {
local line
local -a commands
local -a global_options
global_options=(
'(-v --verbose)'{-v,--verbose}'[Enable detailed debug logging]'
'(-h --help)'{-h,--help}'[Show help message]'
'--version[Show version information]'
)
commands=(
'toggle:Starts or stops the recording'
'daemon:Starts the background background service'
'discard:Abort current recording without transcribing'
'onboard:Configure the application'
'latency-test:Benchmark full pipeline without recording'
'show:Show current configuration'
'config:Update a specific configuration setting'
'skill:Manage dynamic skills (list, add, remove)'
)
_arguments -C \
$global_options \
'1: :->cmds' \
'*:: :->args'
case $state in
cmds)
_describe -t commands 'command' commands
;;
args)
case $words[1] in
toggle)
_arguments \
'(-p --pipe)'{-p,--pipe}'[Output transcription to stdout instead of typing]' \
'--copy[Copy to clipboard instead of typing]'
;;
discard)
_arguments \
'(-p --pipe)'{-p,--pipe}'[Output transcription to stdout instead of typing]'
;;
config)
_arguments \
'1:key:(llm whisper language lang backend punctuation tech)' \
'2:value:'
;;
skill)
local -a skill_cmds
skill_cmds=(
'list:List all available skills'
'add:Add a new skill interactively'
'remove:Remove a skill'
)
_describe -t commands 'skill command' skill_cmds
;;
*)
_message "no more arguments"
;;
esac
;;
esac
}
_toak "$@"