#compdef mm autoload -U is-at-least _mm() { typeset -A opt_args typeset -a _arguments_options local ret=1 if is-at-least 5.2; then _arguments_options=(-s -S -C) else _arguments_options=(-s -C) fi local context curcontext="$curcontext" state line _arguments "${_arguments_options[@]}" : \ '--config=[]:PATH:_files' \ '*-o+[Paths without a toml extension refer to a preset]:PATH:_files' \ '*--override=[Paths without a toml extension refer to a preset]:PATH:_files' \ '--download=[Download ALL presets from GitHub. Optionally, downloads a subfolder]::FOLDER:_default' \ '-d+[Display documentation]:DOC:(options binds template other)' \ '--doc=[Display documentation]:DOC:(options binds template other)' \ '--dump-config[Write the default configuration to the default location. If piped, writes the current configuration to stdout]' \ '-F[]' \ '--test-keys[]' \ '--last-key[Print the last key pressed in the last \`mm\` run]' \ '--no-read[Force the default command to run]' \ '(-v)*-q[Reduce the verbosity level]' \ '(-q)*-v[Increase the verbosity level]' \ '-h[Print help]' \ '--help[Print help]' \ '*::args -- args passed to the populating command:_default' \ && ret=0 } (( $+functions[_mm_commands] )) || _mm_commands() { local commands; commands=() _describe -t commands 'mm commands' commands "$@" } if [ "$funcstack[1]" = "_mm" ]; then _mm "$@" else compdef _mm mm fi