Skip to content

Commit

Permalink
完善命令补全
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Dec 9, 2020
1 parent 22c2dd1 commit f366e30
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions v2ray
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bash completion for v2ray
function _auto_tab() {
local options_array=("start" "stop" "restart" "status" "update" "update.sh" "add" "del" "info" "port" "tls" "tfo" "stream" "iptables" "cdn" "stats" "clean" "log" "new" "-h" "-v")
local options_array=("start" "stop" "restart" "status" "update" "update.sh" "add" "del" "info" "port" "tls" "tfo" "stream" "iptables" "cdn" "stats" "clean" "log" "new" "rm" "-h" "-v")
local add_array=("wechat" "utp" "srtp" "dtls" "wireguard" "socks" "mtproto" "ss" "vless" "vless_ws" "vless_xtls" "trojan" "ss" "quic" "h2" "tcp" "tcp_host" "ws")
local log_array=("access" "a" "error" "e")
local cur prev
Expand All @@ -12,6 +12,8 @@ function _auto_tab() {
case $prev in
'v2ray')
COMPREPLY=( $(compgen -W "${options_array[*]}" -- $cur) ) ;;
'xray')
COMPREPLY=( $(compgen -W "${options_array[*]}" -- $cur) ) ;;
'add')
COMPREPLY=( $(compgen -W "${add_array[*]}" -- $cur) );;
'log')
Expand All @@ -22,4 +24,4 @@ function _auto_tab() {

return 0
}
complete -F _auto_tab v2ray
complete -F _auto_tab v2ray xray

0 comments on commit f366e30

Please sign in to comment.