From: Yu Watanabe Date: Thu, 13 Dec 2018 16:26:25 +0000 (+0900) Subject: bash-completion: bootctl: suggest argument for --path option X-Git-Tag: v240~66^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed0c5a6f8966ba3a128ec7762f4e33846dfae643;p=thirdparty%2Fsystemd.git bash-completion: bootctl: suggest argument for --path option --- diff --git a/shell-completion/bash/bootctl b/shell-completion/bash/bootctl index f45e3e2a973..648103fbc0a 100644 --- a/shell-completion/bash/bootctl +++ b/shell-completion/bash/bootctl @@ -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