From ed0c5a6f8966ba3a128ec7762f4e33846dfae643 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 14 Dec 2018 01:26:25 +0900 Subject: bash-completion: bootctl: suggest argument for --path option --- shell-completion/bash/bootctl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'shell-completion') diff --git a/shell-completion/bash/bootctl b/shell-completion/bash/bootctl index f45e3e2a9..648103fbc 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 -- cgit v1.2.3-65-gdbad