From 3eb329bfb5df8f5b6eba9cef195dff54b9ba0e4b Mon Sep 17 00:00:00 2001 From: Arthur Zamarin Date: Fri, 26 Apr 2024 12:10:26 +0300 Subject: [PATCH] shell completion: fix machinectl import-{tar,raw} Signed-off-by: Arthur Zamarin --- shell-completion/bash/machinectl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shell-completion/bash/machinectl b/shell-completion/bash/machinectl index f4d46c95112..b3c2e501641 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") ) -- 2.47.3