aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-12-14 01:26:25 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-12-14 01:26:25 +0900
commited0c5a6f8966ba3a128ec7762f4e33846dfae643 (patch)
tree3dedd19d7a3654c8e03585b72d4a42a8ba4dcfa8 /shell-completion
parentbash-completion: bootctl: add one missing option (diff)
downloadsystemd-ed0c5a6f8966ba3a128ec7762f4e33846dfae643.tar.gz
systemd-ed0c5a6f8966ba3a128ec7762f4e33846dfae643.tar.bz2
systemd-ed0c5a6f8966ba3a128ec7762f4e33846dfae643.zip
bash-completion: bootctl: suggest argument for --path option
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/bootctl15
1 files changed, 15 insertions, 0 deletions
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