diff options
author | Christian Duerr <contact@christianduerr.com> | 2022-01-04 19:25:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 18:25:26 +0000 |
commit | 437f42f8d30fb6d4843738fbd46bb801679443a7 (patch) | |
tree | 838390f1fcae3a802249ef21b8265bf614a650dd /extra/completions | |
parent | 75c14b9bb82fd2bf116785fba879bc22160400cc (diff) | |
download | alacritty-437f42f8d30fb6d4843738fbd46bb801679443a7.tar.gz alacritty-437f42f8d30fb6d4843738fbd46bb801679443a7.zip |
Migrate from structopt to clap 3
Diffstat (limited to 'extra/completions')
-rw-r--r-- | extra/completions/_alacritty | 93 | ||||
-rw-r--r-- | extra/completions/alacritty.bash | 31 | ||||
-rw-r--r-- | extra/completions/alacritty.fish | 53 |
3 files changed, 77 insertions, 100 deletions
diff --git a/extra/completions/_alacritty b/extra/completions/_alacritty index ad93e6bc..4f482236 100644 --- a/extra/completions/_alacritty +++ b/extra/completions/_alacritty @@ -15,26 +15,26 @@ _alacritty() { local context curcontext="$curcontext" state line _arguments "${_arguments_options[@]}" \ -'--embed=[Defines the X11 window ID (as a decimal integer) to embed Alacritty within]' \ -'--config-file=[Specify alternative configuration file \[default: $XDG_CONFIG_HOME/alacritty/alacritty.yml\]]' \ -'--socket=[Path for IPC socket creation]' \ -'*-o+[Override configuration file options \[example: cursor.style=Beam\]]' \ -'*--option=[Override configuration file options \[example: cursor.style=Beam\]]' \ -'--working-directory=[Start the shell in the specified working directory]' \ -'*-e+[Command and args to execute (must be last argument)]' \ -'*--command=[Command and args to execute (must be last argument)]' \ -'-t+[Defines the window title \[default: Alacritty\]]' \ -'--title=[Defines the window title \[default: Alacritty\]]' \ -'--class=[Defines window class/app_id on X11/Wayland \[default: Alacritty\]]' \ +'--embed=[Defines the X11 window ID (as a decimal integer) to embed Alacritty within]:EMBED: ' \ +'--config-file=[Specify alternative configuration file \[default: $XDG_CONFIG_HOME/alacritty/alacritty.yml\]]:CONFIG_FILE: ' \ +'--socket=[Path for IPC socket creation]:SOCKET: ' \ +'*-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: ' \ +'*-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\]]:instance> | <instance>,<general: ' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'-V[Print version information]' \ +'--version[Print version information]' \ '--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[Prints help information]' \ -'--help[Prints help information]' \ -'-V[Prints version information]' \ -'--version[Prints version information]' \ ":: :_alacritty_commands" \ "*::: :->alacritty" \ && ret=0 @@ -46,16 +46,15 @@ _alacritty() { case $line[1] in (msg) _arguments "${_arguments_options[@]}" \ -'-s+[IPC socket connection path override]' \ -'--socket=[IPC socket connection path override]' \ -'-h[Prints help information]' \ -'--help[Prints help information]' \ -'-V[Prints version information]' \ -'--version[Prints version information]' \ +'-s+[IPC socket connection path override]:SOCKET: ' \ +'--socket=[IPC socket connection path override]:SOCKET: ' \ +'-h[Print help information]' \ +'--help[Print help information]' \ ":: :_alacritty__msg_commands" \ "*::: :->msg" \ && ret=0 -case $state in + + case $state in (msg) words=($line[1] "${words[@]}") (( CURRENT += 1 )) @@ -63,25 +62,23 @@ case $state in case $line[1] in (create-window) _arguments "${_arguments_options[@]}" \ -'--working-directory=[Start the shell in the specified working directory]' \ -'*-e+[Command and args to execute (must be last argument)]' \ -'*--command=[Command and args to execute (must be last argument)]' \ -'-t+[Defines the window title \[default: Alacritty\]]' \ -'--title=[Defines the window title \[default: Alacritty\]]' \ -'--class=[Defines window class/app_id on X11/Wayland \[default: Alacritty\]]' \ +'--working-directory=[Start the shell in the specified working directory]:WORKING_DIRECTORY: ' \ +'*-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\]]:instance> | <instance>,<general: ' \ +'--version[Print version information]' \ '--hold[Remain open after child process exit]' \ -'-h[Prints help information]' \ -'--help[Prints help information]' \ -'-V[Prints version information]' \ -'--version[Prints version information]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ && ret=0 ;; (help) _arguments "${_arguments_options[@]}" \ -'-h[Prints help information]' \ -'--help[Prints help information]' \ -'-V[Prints version information]' \ -'--version[Prints version information]' \ +'--version[Print version information]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ && ret=0 ;; esac @@ -90,10 +87,6 @@ esac ;; (help) _arguments "${_arguments_options[@]}" \ -'-h[Prints help information]' \ -'--help[Prints help information]' \ -'-V[Prints version information]' \ -'--version[Prints version information]' \ && ret=0 ;; esac @@ -104,37 +97,31 @@ esac (( $+functions[_alacritty_commands] )) || _alacritty_commands() { local commands; commands=( - "msg:Available socket messages" \ -"help:Prints this message or the help of the given subcommand(s)" \ +'msg:Send a message to the Alacritty socket' \ +'help:Print this message or the help of the given subcommand(s)' \ ) _describe -t commands 'alacritty commands' commands "$@" } (( $+functions[_alacritty__msg__create-window_commands] )) || _alacritty__msg__create-window_commands() { - local commands; commands=( - - ) + local commands; commands=() _describe -t commands 'alacritty msg create-window commands' commands "$@" } (( $+functions[_alacritty__help_commands] )) || _alacritty__help_commands() { - local commands; commands=( - - ) + local commands; commands=() _describe -t commands 'alacritty help commands' commands "$@" } (( $+functions[_alacritty__msg__help_commands] )) || _alacritty__msg__help_commands() { - local commands; commands=( - - ) + local commands; commands=() _describe -t commands 'alacritty msg help commands' commands "$@" } (( $+functions[_alacritty__msg_commands] )) || _alacritty__msg_commands() { local commands; commands=( - "create-window:Create a new window in the same Alacritty process" \ -"help:Prints this message or the help of the given subcommand(s)" \ +'create-window:Create a new window in the same Alacritty process' \ +'help:Print this message or the help of the given subcommand(s)' \ ) _describe -t commands 'alacritty msg commands' commands "$@" } diff --git a/extra/completions/alacritty.bash b/extra/completions/alacritty.bash index cc1c1f42..fcdfc6e8 100644 --- a/extra/completions/alacritty.bash +++ b/extra/completions/alacritty.bash @@ -9,10 +9,9 @@ _alacritty() { for i in ${COMP_WORDS[@]} do case "${i}" in - alacritty) + "$1") cmd="alacritty" ;; - create-window) cmd+="__create__window" ;; @@ -29,13 +28,12 @@ _alacritty() { case "${cmd}" in alacritty) - opts=" -q -v -h -V -o -e -t --print-events --ref-test --hold --help --version --embed --config-file --socket --option --working-directory --command --title --class msg help" + 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" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in - --embed) COMPREPLY=($(compgen -f "${cur}")) return 0 @@ -52,7 +50,7 @@ _alacritty() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; - -o) + -o) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; @@ -64,7 +62,7 @@ _alacritty() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; - -e) + -e) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; @@ -72,7 +70,7 @@ _alacritty() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; - -t) + -t) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; @@ -87,15 +85,13 @@ _alacritty() { COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; - alacritty__help) - opts=" -h -V --help --version " + opts="" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in - *) COMPREPLY=() ;; @@ -104,18 +100,17 @@ _alacritty() { return 0 ;; alacritty__msg) - opts=" -h -V -s --help --version --socket create-window help" + opts="-s -h --socket --help create-window help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in - --socket) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; - -s) + -s) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; @@ -127,13 +122,12 @@ _alacritty() { return 0 ;; alacritty__msg__create__window) - opts=" -h -V -e -t --hold --help --version --working-directory --command --title --class " + opts="-e -t -h --version --working-directory --hold --command --title --class --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in - --working-directory) COMPREPLY=($(compgen -f "${cur}")) return 0 @@ -142,7 +136,7 @@ _alacritty() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; - -e) + -e) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; @@ -150,7 +144,7 @@ _alacritty() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; - -t) + -t) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; @@ -166,13 +160,12 @@ _alacritty() { return 0 ;; alacritty__msg__help) - opts=" -h -V --help --version " + opts="-h --version --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in - *) COMPREPLY=() ;; diff --git a/extra/completions/alacritty.fish b/extra/completions/alacritty.fish index a94a81d3..0ad2fd27 100644 --- a/extra/completions/alacritty.fish +++ b/extra/completions/alacritty.fish @@ -1,33 +1,30 @@ -complete -c alacritty -n "__fish_use_subcommand" -l embed -d 'Defines the X11 window ID (as a decimal integer) to embed Alacritty within' -complete -c alacritty -n "__fish_use_subcommand" -l config-file -d 'Specify alternative configuration file [default: $XDG_CONFIG_HOME/alacritty/alacritty.yml]' -complete -c alacritty -n "__fish_use_subcommand" -l socket -d 'Path for IPC socket creation' -complete -c alacritty -n "__fish_use_subcommand" -s o -l option -d 'Override configuration file options [example: cursor.style=Beam]' -complete -c alacritty -n "__fish_use_subcommand" -l working-directory -d 'Start the shell in the specified working directory' -complete -c alacritty -n "__fish_use_subcommand" -s e -l command -d 'Command and args to execute (must be last argument)' -complete -c alacritty -n "__fish_use_subcommand" -s t -l title -d 'Defines the window title [default: Alacritty]' -complete -c alacritty -n "__fish_use_subcommand" -l class -d 'Defines window class/app_id on X11/Wayland [default: Alacritty]' +complete -c alacritty -n "__fish_use_subcommand" -l embed -d 'Defines the X11 window ID (as a decimal integer) to embed Alacritty within' -r +complete -c alacritty -n "__fish_use_subcommand" -l config-file -d 'Specify alternative configuration file [default: $XDG_CONFIG_HOME/alacritty/alacritty.yml]' -r +complete -c alacritty -n "__fish_use_subcommand" -l socket -d 'Path for IPC socket creation' -r +complete -c alacritty -n "__fish_use_subcommand" -s o -l option -d 'Override configuration file options [example: cursor.style=Beam]' -r +complete -c alacritty -n "__fish_use_subcommand" -l working-directory -d 'Start the shell in the specified working directory' -r +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 'Prints help information' -complete -c alacritty -n "__fish_use_subcommand" -s V -l version -d 'Prints version information' -complete -c alacritty -n "__fish_use_subcommand" -f -a "msg" -d 'Available socket messages' -complete -c alacritty -n "__fish_use_subcommand" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)' -complete -c alacritty -n "__fish_seen_subcommand_from msg" -s s -l socket -d 'IPC socket connection path override' -complete -c alacritty -n "__fish_seen_subcommand_from msg" -s h -l help -d 'Prints help information' -complete -c alacritty -n "__fish_seen_subcommand_from msg" -s V -l version -d 'Prints version information' -complete -c alacritty -n "__fish_seen_subcommand_from msg" -f -a "create-window" -d 'Create a new window in the same Alacritty process' -complete -c alacritty -n "__fish_seen_subcommand_from msg" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)' -complete -c alacritty -n "__fish_seen_subcommand_from create-window" -l working-directory -d 'Start the shell in the specified working directory' -complete -c alacritty -n "__fish_seen_subcommand_from create-window" -s e -l command -d 'Command and args to execute (must be last argument)' -complete -c alacritty -n "__fish_seen_subcommand_from create-window" -s t -l title -d 'Defines the window title [default: Alacritty]' -complete -c alacritty -n "__fish_seen_subcommand_from create-window" -l class -d 'Defines window class/app_id on X11/Wayland [default: Alacritty]' -complete -c alacritty -n "__fish_seen_subcommand_from create-window" -l hold -d 'Remain open after child process exit' -complete -c alacritty -n "__fish_seen_subcommand_from create-window" -s h -l help -d 'Prints help information' -complete -c alacritty -n "__fish_seen_subcommand_from create-window" -s V -l version -d 'Prints version information' -complete -c alacritty -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information' -complete -c alacritty -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information' -complete -c alacritty -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information' -complete -c alacritty -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information' +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 help" -s s -l socket -d 'IPC socket connection path override' -r +complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; 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 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 help" -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 __fish_seen_subcommand_from create-window" -l working-directory -d 'Start the shell in the specified working directory' -r +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s e -l command -d 'Command and args to execute (must be last argument)' -r +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 version -d 'Print version information' +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 help" -l version -d 'Print version information' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from help" -s h -l help -d 'Print help information' |