From 9f02fb95685f46c390148eeab760e3a0dcfa49a9 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 16 Jun 2022 17:01:13 +0200 Subject: Add value hints for clap file paths This ensures that the generated completions properly suggest file paths for arguments which accept them. --- extra/completions/_alacritty | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'extra/completions/_alacritty') 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> | ,