forked from I2P_Developers/i2p.i2p
add bash completion scripts
This commit is contained in:
55
installer/resources/bash-completion/eepget
Normal file
55
installer/resources/bash-completion/eepget
Normal file
@@ -0,0 +1,55 @@
|
||||
_eepget()
|
||||
{
|
||||
local cur prev opts
|
||||
_init_completion || return
|
||||
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
opts="-c -e -h -l -m -n -o -p -t -u -x"
|
||||
|
||||
case "${prev}" in
|
||||
-e|-h|-u|-x)
|
||||
return
|
||||
;;
|
||||
-l|-m|-t)
|
||||
if [[ $cur == "" ]]; then
|
||||
COMPREPLY=( $( compgen -P "$cur" -W "{1..9}" ) )
|
||||
elif [[ $cur == "0" ]]; then
|
||||
COMPREPLY=( $( compgen -W "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -P "$cur" -W "{0..9}" ) )
|
||||
fi
|
||||
compopt -o nospace
|
||||
return
|
||||
;;
|
||||
-n)
|
||||
if [[ $cur == "0" ]]; then
|
||||
COMPREPLY=( $( compgen -W "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -P "$cur" -W "{0..9}" ) )
|
||||
fi
|
||||
compopt -o nospace
|
||||
return
|
||||
;;
|
||||
-o)
|
||||
_filedir
|
||||
return
|
||||
;;
|
||||
-p)
|
||||
_known_hosts_real "$cur"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ ${cur} == h* ]] ; then
|
||||
COMPREPLY=( $(compgen -W "http://{a..z}" -- $cur) )
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ ${cur} == -* ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
complete -F _eepget eepget
|
12
installer/resources/bash-completion/i2prouter
Normal file
12
installer/resources/bash-completion/i2prouter
Normal file
@@ -0,0 +1,12 @@
|
||||
_i2prouter()
|
||||
{
|
||||
local cur prev opts
|
||||
_init_completion || return
|
||||
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
opts="console start stop graceful restart condrestart status install remove dump"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
}
|
||||
complete -F _i2prouter i2prouter
|
12
installer/resources/bash-completion/i2prouter-nowrapper
Normal file
12
installer/resources/bash-completion/i2prouter-nowrapper
Normal file
@@ -0,0 +1,12 @@
|
||||
_i2prouter-nowrapper()
|
||||
{
|
||||
local cur prev opts
|
||||
_init_completion || return
|
||||
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
opts=""
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
}
|
||||
complete -F _i2prouter-nowrapper i2prouter-nowrapper
|
Reference in New Issue
Block a user