From 1d111ff65483b94abc5ec88945ba0d97cdf95b09 Mon Sep 17 00:00:00 2001 From: Kim Date: Mon, 20 Feb 2017 20:52:08 +0800 Subject: [PATCH] Updated bash completion (#1284) --- completions/bash/ss-local | 8 ++++---- completions/bash/ss-manager | 12 ++++-------- completions/bash/ss-redir | 8 ++++---- completions/bash/ss-server | 8 ++++---- completions/bash/ss-tunnel | 8 ++++---- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/completions/bash/ss-local b/completions/bash/ss-local index 96fec2e2b..e014af0a2 100644 --- a/completions/bash/ss-local +++ b/completions/bash/ss-local @@ -1,12 +1,12 @@ _ss_local() { local cur prev opts ciphers - opts='-s -b -p -k -f -t -m -c -a -n -u -U -v -h -A --fast-open --mtu --help --mptcp -i --acl -l' - ciphers='rc4-md5 table rc4 aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr bf-cfb camellia-128-cfb camellia-192-cfb camellia-256-cfb cast5-cfb des-cfb idea-cfb rc2-cfb seed-cfb salsa20 chacha20 and chacha20-ietf' + opts='-s -p -l -k -m -a -f -t -c -n -i -b -u -U -v -h --reuse-port --fast-open --acl --mtu --mptcp --key --plugin --plugin-opts --help' + ciphers='rc4-md5 aes-128-gcm aes-192-gcm aes-256-gcm aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr camellia-128-cfb camellia-192-cfb camellia-256-cfb bf-cfb chacha20-ietf-poly1305 salsa20 chacha20 chacha20-ietf' cur=${COMP_WORDS[COMP_CWORD]} prev="${COMP_WORDS[COMP_CWORD-1]}" case "$prev" in - -c|-f|--acl) + -f|-c|--acl) _filedir || COMPREPLY=( $(compgen -o plusdirs -f ${cur}) ) ;; -s|-b) @@ -18,7 +18,7 @@ _ss_local() -a) _allowed_users || COMPREPLY=( $(compgen -u -- ${cur}) ) ;; - -p|-k|-t|-n|--mtu|-l) + -p|-l|-k|-t|-n|--mtu|--key|--plugin|--plugin-opts) ;; -i) _available_interfaces -a || true diff --git a/completions/bash/ss-manager b/completions/bash/ss-manager index cfe941ed3..d3168a3b2 100644 --- a/completions/bash/ss-manager +++ b/completions/bash/ss-manager @@ -1,28 +1,24 @@ _ss_manager() { local cur prev opts ciphers - opts='-s -b -p -k -f -t -m -c -a -n -u -U -v -h -A --mtu --help --mptcp -i -l --manager-address --executable' - ciphers='rc4-md5 table rc4 aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr bf-cfb camellia-128-cfb camellia-192-cfb camellia-256-cfb cast5-cfb des-cfb idea-cfb rc2-cfb seed-cfb salsa20 chacha20 and chacha20-ietf' + opts='-s -p -l -k -m -a -f -t -c -n -i -b -u -U -v -h --reuse-port --manager-address --executable --mtu --mptcp --plugin --plugin-opts --help' + ciphers='rc4-md5 aes-128-gcm aes-192-gcm aes-256-gcm aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr camellia-128-cfb camellia-192-cfb camellia-256-cfb bf-cfb chacha20-ietf-poly1305 salsa20 chacha20 chacha20-ietf' cur=${COMP_WORDS[COMP_CWORD]} prev="${COMP_WORDS[COMP_CWORD-1]}" case "$prev" in - -c|-f|--executable) + -f|-c|--executable) _filedir || COMPREPLY=( $(compgen -o plusdirs -f ${cur}) ) ;; -s|-b) _known_hosts_real -- "${cur}" || OMPREPLY=( $(compgen -A hostname -- ${cur}) ) ;; - -L) - compopt -o nospace - _known_hosts_real -c -- "${cur}" || OMPREPLY=( $(compgen -A hostname -S : -- ${cur}) ) - ;; -m) COMPREPLY=( $(compgen -W "$ciphers" -- ${cur}) ) ;; -a) _allowed_users || COMPREPLY=( $(compgen -u -- ${cur}) ) ;; - -p|-k|-t|-n|--mtu|-l) + -p|-l|-k|-t|-n|--mtu|--plugin|--plugin-opts) ;; -i) _available_interfaces -a || true diff --git a/completions/bash/ss-redir b/completions/bash/ss-redir index 86f550016..9a14efe8c 100644 --- a/completions/bash/ss-redir +++ b/completions/bash/ss-redir @@ -1,12 +1,12 @@ _ss_redir() { local cur prev opts ciphers - ciphers='rc4-md5 table rc4 aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr bf-cfb camellia-128-cfb camellia-192-cfb camellia-256-cfb cast5-cfb des-cfb idea-cfb rc2-cfb seed-cfb salsa20 chacha20 and chacha20-ietf' - opts='-s -b -p -k -f -t -m -c -a -n -u -U -v -h -A --mtu --help --mptcp -l' + opts='-s -p -l -k -m -a -f -t -c -n -b -u -U -v -h --reuse-port --mtu --mptcp --key --plugin --plugin-opts --help' + ciphers='rc4-md5 aes-128-gcm aes-192-gcm aes-256-gcm aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr camellia-128-cfb camellia-192-cfb camellia-256-cfb bf-cfb chacha20-ietf-poly1305 salsa20 chacha20 chacha20-ietf' cur=${COMP_WORDS[COMP_CWORD]} prev="${COMP_WORDS[COMP_CWORD-1]}" case "$prev" in - -c|-f) + -f|-c) _filedir || COMPREPLY=( $(compgen -o plusdirs -f ${cur}) ) ;; -s|-b) @@ -18,7 +18,7 @@ _ss_redir() -a) _allowed_users || COMPREPLY=( $(compgen -u -- ${cur}) ) ;; - -p|-k|-t|-n|--mtu|-l) + -p|-l|-k|-t|-n|--mtu|--key|--plugin|--plugin-opts) ;; *) COMPREPLY+=( $(compgen -W "${opts}" -- ${cur}) ) diff --git a/completions/bash/ss-server b/completions/bash/ss-server index 7946a2b5b..4d428ccda 100644 --- a/completions/bash/ss-server +++ b/completions/bash/ss-server @@ -1,13 +1,13 @@ _ss_server() { local cur prev opts ciphers - opts='-s -b -p -k -f -t -m -c -a -n -u -U -v -h -A --fast-open --mtu --help --mptcp -i -6 -d --manager-address --acl' - ciphers='rc4-md5 table rc4 aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr bf-cfb camellia-128-cfb camellia-192-cfb camellia-256-cfb cast5-cfb des-cfb idea-cfb rc2-cfb seed-cfb salsa20 chacha20 and chacha20-ietf' + opts='-s -p -l -k -m -a -f -t -c -n -i -b -u -U -6 -d -v -h --reuse-port --fast-open --acl --manager-address --mtu --mptcp --key --plugin --plugin-opts --help' + ciphers='rc4-md5 aes-128-gcm aes-192-gcm aes-256-gcm aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr camellia-128-cfb camellia-192-cfb camellia-256-cfb bf-cfb chacha20-ietf-poly1305 salsa20 chacha20 chacha20-ietf' COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} prev="${COMP_WORDS[COMP_CWORD-1]}" case "$prev" in - -c|-f|--acl) + -f|-c|--acl) _filedir || COMPREPLY=( $(compgen -o plusdirs -f ${cur}) ) ;; -s|-b) @@ -19,7 +19,7 @@ _ss_server() -a) _allowed_users || COMPREPLY=( $(compgen -u -- ${cur}) ) ;; - -p|-k|-t|-n|--mtu|-d) + -p|-l|-k|-t|-n|-d|--mtu|--key|--plugin|--plugin-opts) ;; --manager-address) _known_hosts_real -- "${cur}" || OMPREPLY=( $(compgen -A hostname -- ${cur}) ) diff --git a/completions/bash/ss-tunnel b/completions/bash/ss-tunnel index b3c16eb70..707dc7a9d 100644 --- a/completions/bash/ss-tunnel +++ b/completions/bash/ss-tunnel @@ -1,13 +1,13 @@ _ss_tunnel() { local cur prev opts ciphers - ciphers='rc4-md5 table rc4 aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr bf-cfb camellia-128-cfb camellia-192-cfb camellia-256-cfb cast5-cfb des-cfb idea-cfb rc2-cfb seed-cfb salsa20 chacha20 and chacha20-ietf' - opts='-s -b -p -k -f -t -m -c -a -n -u -U -v -h -A --mtu --help --mptcp -i -l -L' + opts='-s -p -l -k -m -a -f -t -c -n -i -b -u -U -L -v -h --reuse-port --mtu --mptcp --key --plugin --plugin-opts --help' + ciphers='rc4-md5 aes-128-gcm aes-192-gcm aes-256-gcm aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr camellia-128-cfb camellia-192-cfb camellia-256-cfb bf-cfb chacha20-ietf-poly1305 salsa20 chacha20 chacha20-ietf' cur=${COMP_WORDS[COMP_CWORD]} prev="${COMP_WORDS[COMP_CWORD-1]}" compopt +o nospace case "$prev" in - -c|-f) + -f|-c) _filedir || COMPREPLY=( $(compgen -o plusdirs -f ${cur}) ) ;; -s|-b) @@ -23,7 +23,7 @@ _ss_tunnel() -a) _allowed_users || COMPREPLY=( $(compgen -u -- ${cur}) ) ;; - -p|-k|-t|-n|--mtu|-l) + -p|-l|-k|-t|-n|--mtu|--key|--plugin|--plugin-opts) ;; -i) _available_interfaces -a || true