diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2023-05-16 08:57:39 +0300 |
---|---|---|
committer | Kirill Chibisov <contact@kchibisov.com> | 2023-05-17 08:36:41 +0300 |
commit | 6f6ad2b2eec9dbc9b3a1b0190d4a2dfd3c0b3bf6 (patch) | |
tree | 7bf2ac2542e2c4c601fc085d021e44601d8260b0 /extra | |
parent | 04811c674ba01a0f68d9842c33816b78fe3253ab (diff) | |
download | alacritty-6f6ad2b2eec9dbc9b3a1b0190d4a2dfd3c0b3bf6.tar.gz alacritty-6f6ad2b2eec9dbc9b3a1b0190d4a2dfd3c0b3bf6.zip |
Update clap to v4.2.7
Fixes #6879.
Fixes #6874.
Diffstat (limited to 'extra')
-rw-r--r-- | extra/completions/_alacritty | 159 | ||||
-rw-r--r-- | extra/completions/alacritty.bash | 150 | ||||
-rw-r--r-- | extra/completions/alacritty.fish | 17 |
3 files changed, 283 insertions, 43 deletions
diff --git a/extra/completions/_alacritty b/extra/completions/_alacritty index b9ae3518..c4f586bb 100644 --- a/extra/completions/_alacritty +++ b/extra/completions/_alacritty @@ -16,25 +16,25 @@ _alacritty() { local context curcontext="$curcontext" state line _arguments "${_arguments_options[@]}" \ '--embed=[X11 window ID to embed Alacritty within (decimal or hexadecimal with "0x" prefix)]:EMBED: ' \ -'--config-file=[Specify alternative configuration file \[default: $XDG_CONFIG_HOME/alacritty/alacritty.yml\]]:CONFIG_FILE:_files' \ +'--config-file=[Specify alternative configuration file \[default\: \$XDG_CONFIG_HOME/alacritty/alacritty.yml\]]:CONFIG_FILE:_files' \ '--socket=[Path for IPC socket creation]:SOCKET:_files' \ -'*-o+[Override configuration file options \[example: cursor.style=Beam\]]:OPTION: ' \ -'*--option=[Override configuration file options \[example: cursor.style=Beam\]]:OPTION: ' \ +'*-o+[Override configuration file options \[example\: cursor.style=Beam\]]:OPTION: ' \ +'*--option=[Override configuration file options \[example\: cursor.style=Beam\]]:OPTION: ' \ '--working-directory=[Start the shell in the specified working directory]:WORKING_DIRECTORY:_files' \ '*-e+[Command and args to execute (must be last argument)]:COMMAND: ' \ '*--command=[Command and args to execute (must be last argument)]:COMMAND: ' \ -'-T+[Defines the window title \[default: Alacritty\]]:TITLE: ' \ -'--title=[Defines the window title \[default: Alacritty\]]:TITLE: ' \ -'--class=[Defines window class/app_id on X11/Wayland \[default: Alacritty\]]:general> | <general>,<instance: ' \ -'-h[Print help information]' \ -'--help[Print help information]' \ -'-V[Print version information]' \ -'--version[Print version information]' \ +'-T+[Defines the window title \[default\: Alacritty\]]:TITLE: ' \ +'--title=[Defines the window title \[default\: Alacritty\]]:TITLE: ' \ +'--class=[Defines window class/app_id on X11/Wayland \[default\: Alacritty\]]:general> | <general>,<instance: ' \ '--print-events[Print all events to stdout]' \ '--ref-test[Generates ref test]' \ '(-v)*-q[Reduces the level of verbosity (the min level is -qq)]' \ '(-q)*-v[Increases the level of verbosity (the max level is -vvv)]' \ '--hold[Remain open after child process exit]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'-V[Print version]' \ +'--version[Print version]' \ ":: :_alacritty_commands" \ "*::: :->alacritty" \ && ret=0 @@ -48,8 +48,8 @@ _alacritty() { _arguments "${_arguments_options[@]}" \ '-s+[IPC socket connection path override]:SOCKET:_files' \ '--socket=[IPC socket connection path override]:SOCKET:_files' \ -'-h[Print help information]' \ -'--help[Print help information]' \ +'-h[Print help]' \ +'--help[Print help]' \ ":: :_alacritty__msg_commands" \ "*::: :->msg" \ && ret=0 @@ -65,12 +65,12 @@ _arguments "${_arguments_options[@]}" \ '--working-directory=[Start the shell in the specified working directory]:WORKING_DIRECTORY:_files' \ '*-e+[Command and args to execute (must be last argument)]:COMMAND: ' \ '*--command=[Command and args to execute (must be last argument)]:COMMAND: ' \ -'-T+[Defines the window title \[default: Alacritty\]]:TITLE: ' \ -'--title=[Defines the window title \[default: Alacritty\]]:TITLE: ' \ -'--class=[Defines window class/app_id on X11/Wayland \[default: Alacritty\]]:general> | <general>,<instance: ' \ +'-T+[Defines the window title \[default\: Alacritty\]]:TITLE: ' \ +'--title=[Defines the window title \[default\: Alacritty\]]:TITLE: ' \ +'--class=[Defines window class/app_id on X11/Wayland \[default\: Alacritty\]]:general> | <general>,<instance: ' \ '--hold[Remain open after child process exit]' \ -'-h[Print help information]' \ -'--help[Print help information]' \ +'-h[Print help]' \ +'--help[Print help]' \ && ret=0 ;; (config) @@ -79,14 +79,73 @@ _arguments "${_arguments_options[@]}" \ '--window-id=[Window ID for the new config]:WINDOW_ID: ' \ '()-r[Clear all runtime configuration changes]' \ '()--reset[Clear all runtime configuration changes]' \ -'-h[Print help information]' \ -'--help[Print help information]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ '*::options -- Configuration file options \[example\: cursor.style=Beam\]:' \ && ret=0 ;; (help) _arguments "${_arguments_options[@]}" \ -'*::subcommand -- The subcommand whose help message to display:' \ +":: :_alacritty__msg__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:alacritty-msg-help-command-$line[1]:" + case $line[1] in + (create-window) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(config) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_alacritty__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:alacritty-help-command-$line[1]:" + case $line[1] in + (msg) +_arguments "${_arguments_options[@]}" \ +":: :_alacritty__help__msg_commands" \ +"*::: :->msg" \ +&& ret=0 + + case $state in + (msg) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:alacritty-help-msg-command-$line[1]:" + case $line[1] in + (create-window) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(config) +_arguments "${_arguments_options[@]}" \ && ret=0 ;; esac @@ -95,12 +154,15 @@ esac ;; (help) _arguments "${_arguments_options[@]}" \ -'*::subcommand -- The subcommand whose help message to display:' \ && ret=0 ;; esac ;; esac +;; + esac + ;; +esac } (( $+functions[_alacritty_commands] )) || @@ -111,26 +173,71 @@ _alacritty_commands() { ) _describe -t commands 'alacritty commands' commands "$@" } +(( $+functions[_alacritty__help__msg__config_commands] )) || +_alacritty__help__msg__config_commands() { + local commands; commands=() + _describe -t commands 'alacritty help msg config commands' commands "$@" +} (( $+functions[_alacritty__msg__config_commands] )) || _alacritty__msg__config_commands() { local commands; commands=() _describe -t commands 'alacritty msg config commands' commands "$@" } +(( $+functions[_alacritty__msg__help__config_commands] )) || +_alacritty__msg__help__config_commands() { + local commands; commands=() + _describe -t commands 'alacritty msg help config commands' commands "$@" +} +(( $+functions[_alacritty__help__msg__create-window_commands] )) || +_alacritty__help__msg__create-window_commands() { + local commands; commands=() + _describe -t commands 'alacritty help msg create-window commands' commands "$@" +} (( $+functions[_alacritty__msg__create-window_commands] )) || _alacritty__msg__create-window_commands() { local commands; commands=() _describe -t commands 'alacritty msg create-window commands' commands "$@" } +(( $+functions[_alacritty__msg__help__create-window_commands] )) || +_alacritty__msg__help__create-window_commands() { + local commands; commands=() + _describe -t commands 'alacritty msg help create-window commands' commands "$@" +} (( $+functions[_alacritty__help_commands] )) || _alacritty__help_commands() { - local commands; commands=() + local commands; commands=( +'msg:Send a message to the Alacritty socket' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) _describe -t commands 'alacritty help commands' commands "$@" } +(( $+functions[_alacritty__help__help_commands] )) || +_alacritty__help__help_commands() { + local commands; commands=() + _describe -t commands 'alacritty help help commands' commands "$@" +} (( $+functions[_alacritty__msg__help_commands] )) || _alacritty__msg__help_commands() { - local commands; commands=() + local commands; commands=( +'create-window:Create a new window in the same Alacritty process' \ +'config:Update the Alacritty configuration' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) _describe -t commands 'alacritty msg help commands' commands "$@" } +(( $+functions[_alacritty__msg__help__help_commands] )) || +_alacritty__msg__help__help_commands() { + local commands; commands=() + _describe -t commands 'alacritty msg help help commands' commands "$@" +} +(( $+functions[_alacritty__help__msg_commands] )) || +_alacritty__help__msg_commands() { + local commands; commands=( +'create-window:Create a new window in the same Alacritty process' \ +'config:Update the Alacritty configuration' \ + ) + _describe -t commands 'alacritty help msg commands' commands "$@" +} (( $+functions[_alacritty__msg_commands] )) || _alacritty__msg_commands() { local commands; commands=( @@ -141,4 +248,8 @@ _alacritty__msg_commands() { _describe -t commands 'alacritty msg commands' commands "$@" } -_alacritty "$@" +if [ "$funcstack[1]" = "_alacritty" ]; then + _alacritty "$@" +else + compdef _alacritty alacritty +fi diff --git a/extra/completions/alacritty.bash b/extra/completions/alacritty.bash index 60025f5f..bb70ef3f 100644 --- a/extra/completions/alacritty.bash +++ b/extra/completions/alacritty.bash @@ -1,5 +1,5 @@ _alacritty() { - local i cur prev opts cmds + local i cur prev opts cmd COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" @@ -8,21 +8,45 @@ _alacritty() { for i in ${COMP_WORDS[@]} do - case "${i}" in - "$1") + case "${cmd},${i}" in + ",$1") cmd="alacritty" ;; - config) - cmd+="__config" + alacritty,help) + cmd="alacritty__help" ;; - create-window) - cmd+="__create__window" + alacritty,msg) + cmd="alacritty__msg" ;; - help) - cmd+="__help" + alacritty__help,help) + cmd="alacritty__help__help" ;; - msg) - cmd+="__msg" + alacritty__help,msg) + cmd="alacritty__help__msg" + ;; + alacritty__help__msg,config) + cmd="alacritty__help__msg__config" + ;; + alacritty__help__msg,create-window) + cmd="alacritty__help__msg__create__window" + ;; + alacritty__msg,config) + cmd="alacritty__msg__config" + ;; + alacritty__msg,create-window) + cmd="alacritty__msg__create__window" + ;; + alacritty__msg,help) + cmd="alacritty__msg__help" + ;; + alacritty__msg__help,config) + cmd="alacritty__msg__help__config" + ;; + alacritty__msg__help,create-window) + cmd="alacritty__msg__help__create__window" + ;; + alacritty__msg__help,help) + cmd="alacritty__msg__help__help" ;; *) ;; @@ -31,7 +55,7 @@ _alacritty() { case "${cmd}" in alacritty) - opts="-h -V -q -v -o -e -T --help --version --print-events --ref-test --embed --config-file --socket --option --working-directory --hold --command --title --class msg help" + opts="-q -v -o -e -T -h -V --print-events --ref-test --embed --config-file --socket --option --working-directory --hold --command --title --class --help --version msg help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -89,7 +113,7 @@ _alacritty() { return 0 ;; alacritty__help) - opts="<SUBCOMMAND>..." + opts="msg help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -102,6 +126,62 @@ _alacritty() { COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; + alacritty__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + alacritty__help__msg) + opts="create-window config" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + alacritty__help__msg__config) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + alacritty__help__msg__create__window) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; alacritty__msg) opts="-s -h --socket --help create-window config help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then @@ -185,7 +265,7 @@ _alacritty() { return 0 ;; alacritty__msg__help) - opts="<SUBCOMMAND>..." + opts="create-window config help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -198,6 +278,48 @@ _alacritty() { COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; + alacritty__msg__help__config) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + alacritty__msg__help__create__window) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + alacritty__msg__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; esac } diff --git a/extra/completions/alacritty.fish b/extra/completions/alacritty.fish index 2ff7c1f1..2d80be62 100644 --- a/extra/completions/alacritty.fish +++ b/extra/completions/alacritty.fish @@ -6,17 +6,17 @@ complete -c alacritty -n "__fish_use_subcommand" -l working-directory -d 'Start complete -c alacritty -n "__fish_use_subcommand" -s e -l command -d 'Command and args to execute (must be last argument)' -r complete -c alacritty -n "__fish_use_subcommand" -s T -l title -d 'Defines the window title [default: Alacritty]' -r complete -c alacritty -n "__fish_use_subcommand" -l class -d 'Defines window class/app_id on X11/Wayland [default: Alacritty]' -r -complete -c alacritty -n "__fish_use_subcommand" -s h -l help -d 'Print help information' -complete -c alacritty -n "__fish_use_subcommand" -s V -l version -d 'Print version information' complete -c alacritty -n "__fish_use_subcommand" -l print-events -d 'Print all events to stdout' complete -c alacritty -n "__fish_use_subcommand" -l ref-test -d 'Generates ref test' complete -c alacritty -n "__fish_use_subcommand" -s q -d 'Reduces the level of verbosity (the min level is -qq)' complete -c alacritty -n "__fish_use_subcommand" -s v -d 'Increases the level of verbosity (the max level is -vvv)' complete -c alacritty -n "__fish_use_subcommand" -l hold -d 'Remain open after child process exit' +complete -c alacritty -n "__fish_use_subcommand" -s h -l help -d 'Print help' +complete -c alacritty -n "__fish_use_subcommand" -s V -l version -d 'Print version' complete -c alacritty -n "__fish_use_subcommand" -f -a "msg" -d 'Send a message to the Alacritty socket' complete -c alacritty -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -s s -l socket -d 'IPC socket connection path override' -r -F -complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -s h -l help -d 'Print help information' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -s h -l help -d 'Print help' complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -f -a "create-window" -d 'Create a new window in the same Alacritty process' complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -f -a "config" -d 'Update the Alacritty configuration' complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' @@ -25,7 +25,14 @@ complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subco complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s T -l title -d 'Defines the window title [default: Alacritty]' -r complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -l class -d 'Defines window class/app_id on X11/Wayland [default: Alacritty]' -r complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -l hold -d 'Remain open after child process exit' -complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s h -l help -d 'Print help information' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s h -l help -d 'Print help' complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from config" -s w -l window-id -d 'Window ID for the new config' -r complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from config" -s r -l reset -d 'Clear all runtime configuration changes' -complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from config" -s h -l help -d 'Print help information' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from config" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -f -a "create-window" -d 'Create a new window in the same Alacritty process' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -f -a "config" -d 'Update the Alacritty configuration' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c alacritty -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from help" -f -a "msg" -d 'Send a message to the Alacritty socket' +complete -c alacritty -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c alacritty -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config" -f -a "create-window" -d 'Create a new window in the same Alacritty process' +complete -c alacritty -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config" -f -a "config" -d 'Update the Alacritty configuration' |