add bash completion scripts

This commit is contained in:
zzz
2017-04-06 13:05:47 +00:00
parent 4edc4077f8
commit dd8f7638c5
11 changed files with 88 additions and 6 deletions

View File

@ -38,7 +38,7 @@ export BITS := $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
#export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
%:
dh $@ --with systemd,quilt
dh $@ --with systemd,quilt,bash-completion
clean: createcopyright

View File

@ -39,7 +39,7 @@ export BITS := $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
#export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
%:
dh $@
dh $@ --with bash-completion
clean: createcopyright

View File

@ -38,7 +38,7 @@ export BITS := $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
#export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
%:
dh $@ --with systemd
dh $@ --with systemd,bash-completion
clean: createcopyright

View File

@ -36,7 +36,7 @@ export DEBIANVERSION := $(shell dpkg-parsechangelog |awk -F' ' '/^Version:/{prin
#export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
%:
dh $@ --with systemd
dh $@ --with systemd,bash-completion
clean: createcopyright

View File

@ -38,7 +38,7 @@ export BITS := $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
#export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
%:
dh $@ --with systemd
dh $@ --with systemd,bash-completion
clean: createcopyright

1
debian/i2p-router.bash-completion vendored Normal file
View File

@ -0,0 +1 @@
installer/resources/bash-completion/eepget

2
debian/i2p.bash-completion vendored Normal file
View File

@ -0,0 +1,2 @@
installer/resources/bash-completion/i2prouter
installer/resources/bash-completion/i2prouter-nowrapper

2
debian/rules vendored
View File

@ -38,7 +38,7 @@ export BITS := $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
#export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
%:
dh $@ --with systemd,quilt
dh $@ --with systemd,quilt,bash-completion
clean: createcopyright

View 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

View 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

View 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