diff options
| -rw-r--r-- | bash_completion | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bash_completion b/bash_completion new file mode 100644 index 0000000..a1d413b --- /dev/null +++ b/bash_completion @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# I don't use bash on the regular, but this seems to work and I imagine is +# useful to many. +_dpw_complete() { + local cur + cur="${COMP_WORDS[COMP_CWORD]}" + local sub="show copy type list ls mv cp rm edit otp fnd find insert" + + if [[ ${COMP_CWORD} -eq 1 ]]; then + COMPREPLY=($(compgen -W "${sub}" -- "${cur}")) + elif [[ ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "$(command dpw list)" -- "${cur}")) + else + COMPREPLY=($(compgen -f -- "${cur}")) + fi + + return 0 +} +complete -F _dpw_complete dpw |
