]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shell completion: fix machinectl import-{tar,raw} 32494/head
authorArthur Zamarin <arthurzam@gentoo.org>
Fri, 26 Apr 2024 09:10:26 +0000 (12:10 +0300)
committerArthur Zamarin <arthurzam@gentoo.org>
Fri, 26 Apr 2024 09:10:30 +0000 (12:10 +0300)
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
shell-completion/bash/machinectl

index f4d46c95112d71fdad31088eb1dacc6bb91b5212..b3c2e501641f6839b0f6e352698a2aad522db283 100644 (file)
@@ -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") )