summaryrefslogtreecommitdiffstats
path: root/shell-completion
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-04-26 11:10:26 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2024-04-26 11:10:30 +0200
commit3eb329bfb5df8f5b6eba9cef195dff54b9ba0e4b (patch)
tree9a4c53e7f707129fd4ee3ce0d8db789aaa1a565f /shell-completion
parentshell completion: add bash completion for importctl (diff)
downloadsystemd-3eb329bfb5df8f5b6eba9cef195dff54b9ba0e4b.tar.xz
systemd-3eb329bfb5df8f5b6eba9cef195dff54b9ba0e4b.zip
shell completion: fix machinectl import-{tar,raw}
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/machinectl8
1 files changed, 6 insertions, 2 deletions
diff --git a/shell-completion/bash/machinectl b/shell-completion/bash/machinectl
index f4d46c9511..b3c2e50164 100644
--- a/shell-completion/bash/machinectl
+++ b/shell-completion/bash/machinectl
@@ -107,8 +107,12 @@ _machinectl() {
comps=$( __get_machines )
elif __contains_word "$verb" ${VERBS[FILE]}; then
- comps=$(compgen -f -- "cur")
- compopt -o filenames
+ if (( COMP_CWORD == i + 1 )); then # first argument after verb
+ comps=$(compgen -f -- "$cur")
+ compopt -o filenames
+ else
+ comps=''
+ fi
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )