aboutsummaryrefslogtreecommitdiff
path: root/extra/completions
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2022-06-16 17:01:13 +0200
committerGitHub <noreply@github.com>2022-06-16 18:01:13 +0300
commit9f02fb95685f46c390148eeab760e3a0dcfa49a9 (patch)
tree50a05564188eaded4a3133560c5caeb7e8b1ddb1 /extra/completions
parentff7f74fd29945ec7913c7b99fd743298164c7888 (diff)
downloadalacritty-9f02fb95685f46c390148eeab760e3a0dcfa49a9.tar.gz
alacritty-9f02fb95685f46c390148eeab760e3a0dcfa49a9.zip
Add value hints for clap file paths
This ensures that the generated completions properly suggest file paths for arguments which accept them.
Diffstat (limited to 'extra/completions')
-rw-r--r--extra/completions/_alacritty20
-rw-r--r--extra/completions/alacritty.bash6
-rw-r--r--extra/completions/alacritty.fish13
3 files changed, 17 insertions, 22 deletions
diff --git a/extra/completions/_alacritty b/extra/completions/_alacritty
index 4f482236..86226236 100644
--- a/extra/completions/_alacritty
+++ b/extra/completions/_alacritty
@@ -16,11 +16,11 @@ _alacritty() {
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \
'--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: ' \
+'--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: ' \
-'--working-directory=[Start the shell in the specified working directory]:WORKING_DIRECTORY: ' \
+'--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: ' \
@@ -46,8 +46,8 @@ _alacritty() {
case $line[1] in
(msg)
_arguments "${_arguments_options[@]}" \
-'-s+[IPC socket connection path override]:SOCKET: ' \
-'--socket=[IPC socket connection path override]:SOCKET: ' \
+'-s+[IPC socket connection path override]:SOCKET:_files' \
+'--socket=[IPC socket connection path override]:SOCKET:_files' \
'-h[Print help information]' \
'--help[Print help information]' \
":: :_alacritty__msg_commands" \
@@ -62,13 +62,12 @@ _arguments "${_arguments_options[@]}" \
case $line[1] in
(create-window)
_arguments "${_arguments_options[@]}" \
-'--working-directory=[Start the shell in the specified working directory]:WORKING_DIRECTORY: ' \
+'--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\]]:instance> | <instance>,<general: ' \
-'--version[Print version information]' \
'--hold[Remain open after child process exit]' \
'-h[Print help information]' \
'--help[Print help information]' \
@@ -76,9 +75,7 @@ _arguments "${_arguments_options[@]}" \
;;
(help)
_arguments "${_arguments_options[@]}" \
-'--version[Print version information]' \
-'-h[Print help information]' \
-'--help[Print help information]' \
+'*::subcommand -- The subcommand whose help message to display:' \
&& ret=0
;;
esac
@@ -87,6 +84,7 @@ esac
;;
(help)
_arguments "${_arguments_options[@]}" \
+'*::subcommand -- The subcommand whose help message to display:' \
&& ret=0
;;
esac
@@ -126,4 +124,4 @@ _alacritty__msg_commands() {
_describe -t commands 'alacritty msg commands' commands "$@"
}
-_alacritty "$@" \ No newline at end of file
+_alacritty "$@"
diff --git a/extra/completions/alacritty.bash b/extra/completions/alacritty.bash
index fcdfc6e8..428e9583 100644
--- a/extra/completions/alacritty.bash
+++ b/extra/completions/alacritty.bash
@@ -86,7 +86,7 @@ _alacritty() {
return 0
;;
alacritty__help)
- opts=""
+ opts="<SUBCOMMAND>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -122,7 +122,7 @@ _alacritty() {
return 0
;;
alacritty__msg__create__window)
- opts="-e -t -h --version --working-directory --hold --command --title --class --help"
+ opts="-e -t -h --working-directory --hold --command --title --class --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -160,7 +160,7 @@ _alacritty() {
return 0
;;
alacritty__msg__help)
- opts="-h --version --help"
+ opts="<SUBCOMMAND>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
diff --git a/extra/completions/alacritty.fish b/extra/completions/alacritty.fish
index 0ad2fd27..f425448b 100644
--- a/extra/completions/alacritty.fish
+++ b/extra/completions/alacritty.fish
@@ -1,8 +1,8 @@
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" -l config-file -d 'Specify alternative configuration file [default: $XDG_CONFIG_HOME/alacritty/alacritty.yml]' -r -F
+complete -c alacritty -n "__fish_use_subcommand" -l socket -d 'Path for IPC socket creation' -r -F
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" -l working-directory -d 'Start the shell in the specified working directory' -r -F
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
@@ -15,16 +15,13 @@ complete -c alacritty -n "__fish_use_subcommand" -s v -d 'Increases the level of
complete -c alacritty -n "__fish_use_subcommand" -l hold -d 'Remain open after child process exit'
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 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 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" -l working-directory -d 'Start the shell in the specified working directory' -r -F
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'