bash-completion: bootctl: suggest argument for --path option

This commit is contained in:
Yu Watanabe 2018-12-14 01:26:25 +09:00
parent 8ed22786aa
commit ed0c5a6f89
1 changed files with 15 additions and 0 deletions

View File

@ -32,6 +32,21 @@ _bootctl() {
[ARG]='--path'
)
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--path)
if [[ -z $cur ]]; then
comps=$(compgen -A directory -- "/" )
else
comps=$(compgen -A directory -- "$cur" )
fi
compopt -o filenames
;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
fi
if [[ "$cur" = -* ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0