From 757a377a78060cc8be90ee5aba0deddd63dcc2e8 Mon Sep 17 00:00:00 2001 From: Francisco Vilmar Cardoso Ruviaro Date: Thu, 28 Oct 2021 23:19:41 +0000 Subject: [PATCH] Add doc/tty-share-bash_completion --- doc/tty-share-bash_completion | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 doc/tty-share-bash_completion diff --git a/doc/tty-share-bash_completion b/doc/tty-share-bash_completion new file mode 100644 index 0000000..dffe480 --- /dev/null +++ b/doc/tty-share-bash_completion @@ -0,0 +1,73 @@ +# bash completion for tty-share -*- shell-script -*- + +_tty-share() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + case $prev in + '-args'|'--args') + COMPREPLY=( $(compgen -W "string" -- $cur) ) + return 0 + ;; + '-command'|'--command') + COMPREPLY=( $(compgen -W "/bin/bash" -- $cur) ) + return 0 + ;; + '-detach-keys'|'--detach-keys') + COMPREPLY=( $(compgen -W "string" -- $cur) ) + return 0 + ;; + '-frontend-path'|'--frontend-path') + COMPREPLY=( $(compgen -W "string" -- $cur) ) + return 0 + ;; + '-listen'|'--listen') + COMPREPLY=( $(compgen -W "localhost:8000" -- $cur) ) + return 0 + ;; + '-logfile'|'--logfile') + COMPREPLY=( $(compgen -W "-" -- $cur) ) + return 0 + ;; + '-no-tls'|'--no-tls') + return 0 + ;; + '-public'|'--public') + return 0 + ;; + '-readonly'|'--readonly') + return 0 + ;; + '-tty-proxy'|'--tty-proxy') + COMPREPLY=( $(compgen -W "on.tty-share.com:4567" -- $cur) ) + return 0 + ;; + '-verbose'|'--verbose') + return 0 + ;; + '-version'|'--version') + return 0 + ;; + esac + case $cur in + -*) + OPTS="--args + --command + --detach-keys + --frontend-path + --listen + --logfile + --no-tls + --public + --readonly + --tty-proxy + --verbose + --version" + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + ;; + esac +} +complete -F _tty-share tty-share