mirror of
https://github.com/angt/secret
synced 2025-01-31 19:57:34 +01:00
7417bf0ee0
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
13 lines
444 B
Bash
13 lines
444 B
Bash
_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) mapfile -t COMPREPLY < <(compgen -A command -- "$last") ;;
|
|
DIR) mapfile -t COMPREPLY < <(compgen -A dir -- "$last") ;;
|
|
FILE) mapfile -t COMPREPLY < <(compgen -A file -- "$last") ;;
|
|
*) mapfile -t COMPREPLY < <(compgen -W "$opts" -- "$last") ;;
|
|
esac
|
|
}
|