diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2024-04-26 11:10:26 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2024-04-26 11:10:30 +0200 |
commit | 3eb329bfb5df8f5b6eba9cef195dff54b9ba0e4b (patch) | |
tree | 9a4c53e7f707129fd4ee3ce0d8db789aaa1a565f | |
parent | shell completion: add bash completion for importctl (diff) | |
download | systemd-3eb329bfb5df8f5b6eba9cef195dff54b9ba0e4b.tar.xz systemd-3eb329bfb5df8f5b6eba9cef195dff54b9ba0e4b.zip |
shell completion: fix machinectl import-{tar,raw}
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r-- | shell-completion/bash/machinectl | 8 |
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") ) |