Update shell completions

This fixes the shell completion by removing the flags removed from the
CLI in 0768428 and adding the new options flag.
This commit is contained in:
Jason 2021-01-17 20:22:06 +09:00 committed by GitHub
parent 3ed9f9ac38
commit 34435ed776
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 32 deletions

View file

@ -15,6 +15,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Crash due to assertion failure on 32-bit architectures
### Packaging
- Updated shell completions
## 0.7.1
### Fixed

View file

@ -5,9 +5,6 @@ local ign
(( $#words > 2 )) && ign='!'
_arguments \
"$ign(-)"{-h,--help}"[print help information]" \
"(--no-live-config-reload)--live-config-reload[enable automatic config reloading]" \
"(--live-config-reload)--no-live-config-reload[disable automatic config reloading]" \
"(--persistent-logging)--persistent-logging[keep the log file after quitting Alacritty]" \
"--print-events[print all events to stdout]" \
'(-v)'{-q,-qq}"[reduce the level of verbosity (min is -qq)]" \
"--ref-test[generate ref test]" \
@ -18,7 +15,6 @@ _arguments \
"--embed=[define the X11 window ID (as a decimal integer) to embed Alacritty within]:windowId" \
"(-e --command)"{-e,--command}"[execute command (must be last arg)]:program: _command_names -e:*::program arguments: _normal" \
"--config-file=[specify an alternative config file]:file:_files" \
"(-d --dimensions)"{-d,--dimensions}"[specify window dimensions]:columns: :lines" \
"--position[specify window position]:x position: :y position" \
"(-t --title)"{-t+,--title=}"[define the window title]:title" \
"*"{-o=,--option=}"[override config file options]:option" \
"(-t --title)"{-t=,--title=}"[define the window title]:title" \
"--working-directory=[start shell in specified directory]:directory:_directories"

View file

@ -11,7 +11,7 @@ _alacritty()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
prevprev="${COMP_WORDS[COMP_CWORD-2]}"
opts="-h --help -V --version --live-config-reload --no-live-config-reload --persistent-logging --print-events -q -qq -v -vv -vvv --ref-test --hold -e --command --config-file -d --dimensions --position -t --title --embed --class --working-directory"
opts="-h --help -V --version --print-events -q -qq -v -vv -vvv --ref-test --hold -e --command --config-file -o --option -t --title --embed --class --working-directory"
# If `--command` or `-e` is used, stop completing
for i in "${!COMP_WORDS[@]}"; do
@ -23,11 +23,6 @@ _alacritty()
fi
done
# Make sure the Y dimension isn't completed
if [[ "${prevprev}" == "--dimensions" ]] || [[ "${prevprev}" == "-d" ]]; then
return 0
fi
# Match the previous word
case "${prev}" in
--command | -e)

View file

@ -9,15 +9,6 @@ complete -c alacritty \
-d "Prints help information"
# Config
complete -c alacritty \
-l "live-config-reload" \
-d "Enable automatic config reloading"
complete -c alacritty \
-l "no-live-config-reload" \
-d "Disable automatic config reloading"
complete -c alacritty \
-l "persistent-logging" \
-d "Keep the log file after quitting Alacritty"
complete -c alacritty \
-f \
-l "config-file" \
@ -40,6 +31,10 @@ complete -c alacritty \
complete -c alacritty \
-l "hold" \
-d "Remain open after child process exits"
complete -c alacritty \
-s "o" \
-l "option" \
-d "Override config file options"
# Output
complete \
@ -72,17 +67,6 @@ complete \
-l "ref-test" \
-d "Generates ref test"
complete \
-c alacritty \
-s "d" \
-l "dimensions" \
-d "Window dimensions <columns> <lines>"
complete \
-c alacritty \
-l "position" \
-d "Window position <x-pos> <y-pos>"
complete \
-c alacritty \
-s "e" \