diff options
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | debian/resteasy.bash-completion | 27 | ||||
-rwxr-xr-x | debian/rules | 2 |
3 files changed, 29 insertions, 2 deletions
diff --git a/debian/control b/debian/control index f5477b1..8b3c4e0 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: resteasy Section: admin Priority: optional Maintainer: Jakob Odersky <jakob@odersky.com> -Build-Depends: debhelper-compat (= 12), pandoc +Build-Depends: debhelper-compat (= 12), bash-completion, pandoc Standards-Version: 4.4.1 Package: resteasy diff --git a/debian/resteasy.bash-completion b/debian/resteasy.bash-completion new file mode 100644 index 0000000..b2a5d5e --- /dev/null +++ b/debian/resteasy.bash-completion @@ -0,0 +1,27 @@ +# shellcheck shell=bash +# shellcheck disable=SC2207 +__resteasy() { + local cur prev + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + case ${COMP_CWORD} in + 1) + local toplevel + toplevel=$(find "$(resteasy --exec-path)" -name 'resteasy-*' -executable -printf '%P\n' | sed s/resteasy-//) + COMPREPLY=($(compgen -W "--exec-path $toplevel" -- "$cur")) + ;; + *) + case $prev in + mount) + COMPREPLY=($(compgen -W "ro" -- "$cur")) + ;; + prepare-drive) + COMPREPLY=($(compgen -W "$(lsblk -pnro name)" -- "$cur")) + ;; + esac + ;; + esac +} +complete -F __resteasy resteasy diff --git a/debian/rules b/debian/rules index 1a0e016..a63b57c 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f %: - dh $@ + dh $@ --with bash-completion override_dh_installman: mkdir -p debian/resteasy/usr/share/man/man8/ |