1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-25 10:22:43 +03:00
wezterm/assets/shell-completion/bash

579 lines
19 KiB
Plaintext
Raw Normal View History

_wezterm() {
local i cur prev opts cmds
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
cmd=""
opts=""
for i in ${COMP_WORDS[@]}
do
case "${i}" in
"$1")
cmd="wezterm"
;;
activate-pane-direction)
cmd+="__activate__pane__direction"
;;
cli)
cmd+="__cli"
;;
connect)
cmd+="__connect"
;;
help)
cmd+="__help"
;;
imgcat)
cmd+="__imgcat"
;;
list)
cmd+="__list"
;;
list-clients)
cmd+="__list__clients"
;;
ls-fonts)
cmd+="__ls__fonts"
;;
move-pane-to-new-tab)
cmd+="__move__pane__to__new__tab"
;;
proxy)
cmd+="__proxy"
;;
record)
cmd+="__record"
;;
replay)
cmd+="__replay"
;;
send-text)
cmd+="__send__text"
;;
serial)
cmd+="__serial"
;;
set-working-directory)
cmd+="__set__working__directory"
;;
shell-completion)
cmd+="__shell__completion"
;;
show-keys)
cmd+="__show__keys"
;;
spawn)
cmd+="__spawn"
;;
split-pane)
cmd+="__split__pane"
;;
ssh)
cmd+="__ssh"
;;
start)
cmd+="__start"
;;
tlscreds)
cmd+="__tlscreds"
;;
*)
;;
esac
done
case "${cmd}" in
wezterm)
opts="-h -V -n --help --version --config-file --config start ssh serial connect ls-fonts show-keys cli imgcat set-working-directory record replay shell-completion help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--config-file)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--config)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli)
opts="-h --no-auto-start --prefer-mux --class --help list list-clients proxy tlscreds move-pane-to-new-tab split-pane spawn send-text activate-pane-direction help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--class)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli__activate__pane__direction)
opts="-h --help Up Down Left Right Next Prev"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli__help)
opts="<SUBCOMMAND>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli__list)
opts="-h --format --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--format)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli__list__clients)
opts="-h --format --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--format)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli__move__pane__to__new__tab)
opts="-h --pane-id --window-id --new-window --workspace --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--pane-id)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--window-id)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--workspace)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli__proxy)
opts="-h --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli__send__text)
opts="-h --pane-id --no-paste --help <TEXT>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--pane-id)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli__spawn)
opts="-h --pane-id --domain-name --window-id --new-window --cwd --workspace --help <PROG>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--pane-id)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--domain-name)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--window-id)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--cwd)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--workspace)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli__split__pane)
opts="-h --pane-id --horizontal --left --right --top --bottom --top-level --cells --percent --cwd --move-pane-id --help <PROG>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--pane-id)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--cells)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--percent)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--cwd)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--move-pane-id)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__cli__tlscreds)
opts="-h --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__connect)
opts="-h --class --workspace --position --help <DOMAIN_NAME> <PROG>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--class)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--workspace)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--position)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__help)
opts="<SUBCOMMAND>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__imgcat)
opts="-h --width --height --no-preserve-aspect-ratio --help <FILE_NAME>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--width)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--height)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__ls__fonts)
2022-09-01 18:39:11 +03:00
opts="-h --list-system --text --rasterize-ascii --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--text)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__record)
opts="-h --help <PROG>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__replay)
opts="-h --explain --help <CAST_FILE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__serial)
opts="-h --baud --class --position --help <PORT>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--baud)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--class)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--position)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__set__working__directory)
opts="-h --help <CWD> <HOST>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__shell__completion)
opts="-h --shell --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--shell)
2022-09-01 18:39:11 +03:00
COMPREPLY=($(compgen -W "bash elvish fish power-shell zsh fig" -- "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__show__keys)
opts="-h --lua --key-table --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--key-table)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__ssh)
opts="-o -v -h --ssh-option --class --position --help <USER_AT_HOST_AND_PORT> <PROG>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--ssh-option)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
-o)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--class)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--position)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wezterm__start)
opts="-h --no-auto-connect --always-new-process --cwd --class --workspace --position --help <PROG>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--cwd)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--class)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--workspace)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--position)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
esac
}
complete -F _wezterm -o bashdefault -o default wezterm