mirror of
https://github.com/angt/secret
synced 2024-11-16 19:48:05 +01:00
9a921c5752
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
17 lines
497 B
Bash
17 lines
497 B
Bash
_argz_reply() {
|
|
while IFS='' read -r line; do COMPREPLY+=("$line"); done
|
|
}
|
|
|
|
_argz() {
|
|
local last opts
|
|
last="${COMP_WORDS[COMP_CWORD]}"
|
|
COMP_WORDS[COMP_CWORD]="help"
|
|
opts="$("${COMP_WORDS[@]}" 2>/dev/null | awk '{print $1}' )"
|
|
case "$opts" in
|
|
'') ;;
|
|
CMD) _argz_reply < <(compgen -A command -- "$last") ;;
|
|
DIR) _argz_reply < <(compgen -A dir -- "$last") ;;
|
|
FILE) _argz_reply < <(compgen -A file -- "$last") ;;
|
|
*) _argz_reply < <(compgen -W "$opts" -- "$last") ;;
|
|
esac
|
|
}
|