]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portablectl: add --extension to bash completion
authorLuca Boccassi <bluca@debian.org>
Tue, 25 Apr 2023 15:45:06 +0000 (16:45 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 25 Apr 2023 23:35:20 +0000 (08:35 +0900)
shell-completion/bash/portablectl

index 31601dceb29ab641232dfb3b21c8eb3fe0498241..30e5da4aa28e06a023bd4d13a9a983b385496513 100644 (file)
@@ -36,7 +36,7 @@ _portablectl() {
     local -A OPTS=(
         [STANDALONE]='-q --quiet --runtime --no-reload --cat --no-pager --no-legend
                               --no-ask-password --enable --now -h --help --version'
-        [ARG]='-p --profile --copy -H --host -M --machine'
+        [ARG]='-p --profile --copy -H --host -M --machine --extension'
     )
 
     local -A VERBS=(
@@ -60,6 +60,10 @@ _portablectl() {
             --machine|-M)
                 comps=$( __get_machines )
                 ;;
+            --extension)
+                comps=$( compgen -A file -- "$cur" )
+                compopt -o filenames
+                ;;
         esac
         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
         return 0