Skip to content

Commit 36955a4

Browse files
authored
Merge pull request #1692 from Bastian-Krause/bst/completion-dfu
contrib/completion: fix dfu sub command file completion
2 parents a58edbd + bddbc40 commit 36955a4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

contrib/completion/labgrid-client.bash

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,6 @@ _labgrid_client_dfu()
382382
--wait)
383383
return
384384
;;
385-
download|detach|list)
386-
_filedir
387-
;;
388385
-n|--name)
389386
_labgrid_complete match-names "$cur"
390387
return
@@ -398,10 +395,14 @@ _labgrid_client_dfu()
398395
*)
399396
local args
400397
_labgrid_count_args "@(--wait|-n|--name)" || return
401-
# only complete second argument
402-
[ "$args" -ne 2 ] && return
403398
404-
COMPREPLY=( $(compgen -W "download detach list" -- "$cur") )
399+
# complete second argument
400+
if [ "$args" -eq 2 ]; then
401+
COMPREPLY=( $(compgen -W "download detach list" -- "$cur") )
402+
return
403+
fi
404+
405+
_filedir
405406
;;
406407
esac
407408
}

0 commit comments

Comments
 (0)