blob: a1d413b3f2678f0a37610b8e9b6b3a6c47c8ad0a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
|