1
0
Files
Toak/_toak

93 lines
3.3 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'
'start:Explicitly starts the recording'
'stop:Explicitly stops the recording'
'status:Outputs the current daemon status'
'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)'
'history:Display recent transcriptions with timestamps'
'stats:Display usage statistics and analytics'
)
_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]'
;;
start)
_arguments \
'(-v --verbose)'{-v,--verbose}'[Enable detailed debug logging]'
;;
stop)
_arguments \
'(-p --pipe)'{-p,--pipe}'[Output transcription to stdout instead of typing]' \
'--copy[Copy to clipboard instead of typing]'
;;
status)
_arguments \
'--json[Output status as JSON]'
;;
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
;;
history)
_arguments \
'(-n --num)'{-n,--num}'[Number of recent entries to show]:count:(5 10 20 50)' \
'--grep[Search through transcription history]:pattern:' \
'--export[Export transcription history to a Markdown file]:file:_files' \
'--shred[Securely delete transcription history]'
;;
*)
_message "no more arguments"
;;
esac
;;
esac
}
_toak "$@"