diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-04-01 22:41:20 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-01 22:41:20 +0000 |
commit | 6f4d1afcf88e275f4a6b8c73cfc904e3833d0dd0 (patch) | |
tree | bd2c870aea77c683e0725a59d1c8ce1f817dba7d /extra/completions | |
parent | 5523f64c6f939ced94d55c569f592320442e8eb9 (diff) | |
download | alacritty-6f4d1afcf88e275f4a6b8c73cfc904e3833d0dd0.tar.gz alacritty-6f4d1afcf88e275f4a6b8c73cfc904e3833d0dd0.zip |
Add official logov0.3.0-rc2
Diffstat (limited to 'extra/completions')
-rw-r--r-- | extra/completions/_alacritty | 25 | ||||
-rw-r--r-- | extra/completions/alacritty.bash | 57 | ||||
-rw-r--r-- | extra/completions/alacritty.fish | 80 |
3 files changed, 162 insertions, 0 deletions
diff --git a/extra/completions/_alacritty b/extra/completions/_alacritty new file mode 100644 index 00000000..0d3df1c3 --- /dev/null +++ b/extra/completions/_alacritty @@ -0,0 +1,25 @@ +#compdef alacritty + +_alacritty() { + local context curcontext="$curcontext" state line + typeset -A opt_args + + _arguments \ + "(-h --help)"{-h,--help}"[Prints help information]" \ + "(-V --version)"{-V,--version}"[Prints version 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]" \ + {-q,-qq}"[Reduces the level of verbosity (min is -qq)]" \ + {-v,-vv,-vvv}"[Increases the level of verbosity (max is -vvv)]" \ + "--ref-test[Generates ref test]" \ + "--config-file[Specify an alternative config file]:file:_files" \ + "(-d --dimensions)"{-d,--dimensions}"[Window dimensions]:dimensions:_guard '<->' width: :_guard '<->' length" \ + "--position[Window position]:position:_guard '<->' x-pos: :_guard '<->' y-pos" \ + "--title[Defines the window title]:title:" \ + "--working-directory[Start shell in specified directory]:directory:_dir_list" \ + "(-e --command)"{-e,--command}"[Execute command (must be last arg)]:program: _command_names -e:*::program arguments: _normal" +} + +_alacritty "$@" diff --git a/extra/completions/alacritty.bash b/extra/completions/alacritty.bash new file mode 100644 index 00000000..086e3cdc --- /dev/null +++ b/extra/completions/alacritty.bash @@ -0,0 +1,57 @@ +#/usr/bin/env bash + +# Load completion function +complete -F _alacritty alacritty + +# Completion function +_alacritty() +{ + local cur prev prevprev opts + COMPREPLY=() + 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 -e --command --config-file -d --dimensions --position -t --title --working-directory" + + # If `--command` or `-e` is used, stop completing + for i in "${!COMP_WORDS[@]}"; do + if [[ "${COMP_WORDS[i]}" == "--command" ]] \ + || [[ "${COMP_WORDS[i]}" == "-e" ]] \ + && [[ "${#COMP_WORDS[@]}" -gt "$(($i + 2))" ]] + then + return 0 + 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) + # Complete all commands in $PATH + COMPREPLY=( $(compgen -c -- "${cur}") ) + return 0;; + --config-file) + # Path based completion + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $(compgen -f -- "${cur}") ) + return 0;; + --dimensions | -d | --title | -t) + # Don't complete here + return 0;; + --working-directory) + # Directory completion + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $(compgen -d -- "${cur}") ) + return 0;; + esac + + # Show all flags if there was no previous word + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 +} diff --git a/extra/completions/alacritty.fish b/extra/completions/alacritty.fish new file mode 100644 index 00000000..5f605349 --- /dev/null +++ b/extra/completions/alacritty.fish @@ -0,0 +1,80 @@ +# Meta +complete -c alacritty \ + -s "v" \ + -l "version" \ + -d "Prints version information" +complete -c alacritty \ + -s "h" \ + -l "help" \ + -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" \ + -d "Specify an alternative config file" +complete -c alacritty \ + -l "title" \ + -d "Defines the window title" +complete -c alacritty \ + -x \ + -a '(__fish_complete_directories (commandline -ct))' \ + -l "working-directory" \ + -d "Start shell in specified directory" + +# Output +complete \ + -c alacritty \ + -l "print-events" \ + -d "Print all events to stdout" +complete \ + -c alacritty \ + -s "q" \ + -d "Reduces the level of verbosity (min is -qq)" +complete \ + -c alacritty \ + -s "qq" \ + -d "Reduces the level of verbosity" +complete \ + -c alacritty \ + -s "v" \ + -d "Increases the level of verbosity" +complete \ + -c alacritty \ + -s "vv" \ + -d "Increases the level of verbosity" +complete \ + -c alacritty \ + -s "vvv" \ + -d "Increases the level of verbosity" + +complete \ + -c alacritty \ + -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" \ + -l "command" \ + -d "Execute command (must be last arg)" |