]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - shell-completion/bash/systemd-nspawn
Merge pull request #17549 from yuwata/tiny-fixes
[thirdparty/systemd.git] / shell-completion / bash / systemd-nspawn
index b4bcba88829bc2712f489f3da1302f609ed40ff4..ebd97a9de1b683205050814a8e54c53453ad2276 100644 (file)
@@ -1,5 +1,5 @@
 # systemd-nspawn(1) completion                  -*- shell-script -*-
-# SPDX-License-Identifier: LGPL-2.1+
+# SPDX-License-Identifier: LGPL-2.1-or-later
 #
 # This file is part of systemd.
 #
@@ -30,12 +30,12 @@ __get_users() {
 
 __get_slices() {
     local a b
-    systemctl list-units -t slice --no-legend --no-pager | { while read a b; do echo " $a"; done; };
+    systemctl list-units -t slice --no-legend --no-pager --plain | { while read a b; do echo " $a"; done; };
 }
 
 __get_machines() {
     local a b
-    machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; };
+    machinectl list --full --no-legend --no-pager | { while read a b; do echo " $a"; done; };
 }
 
 __get_env() {
@@ -71,7 +71,7 @@ _systemd_nspawn() {
                       --pivot-root --property --private-users --network-namespace-path --network-ipvlan
                       --network-veth-extra --network-zone -p --port --system-call-filter --overlay --overlay-ro
                       --settings --rlimit --hostname --no-new-privileges --oom-score-adjust --cpu-affinity
-                      --resolv-conf --timezone'
+                      --resolv-conf --timezone --root-hash-sig'
     )
 
     _init_completion || return
@@ -102,8 +102,8 @@ _systemd_nspawn() {
                 comps='no auto guest try-guest host try-host'
                 ;;
             --bind|--bind-ro)
-                compopt -o nospace
-                comps=$(compgen -S/ -A directory -- "$cur" )
+                compopt -o nospace -o filenames
+                comps=$(compgen -f -- "$cur" )
                 ;;
             --tmpfs)
                 compopt -o nospace
@@ -183,6 +183,10 @@ _systemd_nspawn() {
             --timezone)
                 comps=$( systemd-nspawn --timezone=help 2>/dev/null )
                 ;;
+            --root-hash-sig)
+                compopt -o nospace
+                comps=$( compgen -A file -- "$cur" )
+                ;;
         esac
         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
         return 0