]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - shell-completion/bash/machinectl
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / shell-completion / bash / machinectl
index 61c540278607357df32051c270b559d7c4a33359..802a26260371378ee2ae85c4f1eefa74d51a5df1 100644 (file)
@@ -1,8 +1,8 @@
 # machinectl(1) completion                      -*- shell-script -*-
+# SPDX-License-Identifier: LGPL-2.1+
 #
 # This file is part of systemd.
 #
-# Copyright 2014 Thomas H.P. Andersen
 #
 # systemd is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as published by
@@ -35,13 +35,17 @@ _machinectl() {
         local i verb comps
 
         local -A OPTS=(
-               [STANDALONE]='--all -a --full --help -h --no-ask-password --no-legend --no-pager --version'
-                      [ARG]='--host -H --kill-who -M --machine --property -p --signal -s'
+               [STANDALONE]='--all -a -l --full --help -h --no-ask-password --no-legend --no-pager --version --value
+                             --mkdir --read-only --force -q --quiet'
+                      [ARG]='--host -H --kill-who -M --machine --property -p --signal -s --uid -E --setenv -n --lines
+                             -o --output --verify --format --max-addresses'
         )
 
         local -A VERBS=(
-               [STANDALONE]='list list-images pull-tar pull-raw pull-dkr import-tar import-raw export-tar export-raw list-transfers cancel-transfer'
-                 [MACHINES]='status show start login shell enable disable poweroff reboot terminate kill copy-to copy-from image-status show-image clone rename read-only remove set-limit'
+               [STANDALONE]='list list-images clean pull-tar pull-raw list-transfers cancel-transfer import-fs'
+                 [MACHINES]='status show start stop login shell enable disable poweroff reboot terminate kill bind copy-to copy-from
+                             image-status show-image clone rename read-only remove set-limit export-tar export-raw'
+                     [FILE]='import-tar import-raw'
         )
 
         _init_completion || return
@@ -72,6 +76,15 @@ _machinectl() {
                         --property|-p)
                                 comps=''
                         ;;
+                        --output|-o)
+                                comps=$( machinectl --output=help 2>/dev/null )
+                        ;;
+                        --verify)
+                                comps=$( machinectl --verify=help 2>/dev/null )
+                        ;;
+                        --format)
+                                comps='uncompressed xz gzip bzip2'
+                        ;;
                 esac
                 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
                 return 0
@@ -90,6 +103,10 @@ _machinectl() {
 
         elif __contains_word "$verb" ${VERBS[MACHINES]}; then
                 comps=$( __get_machines )
+
+        elif __contains_word "$verb" ${VERBS[FILE]}; then
+                comps=$(compgen -f -- "cur")
+                compopt -o filenames
         fi
 
         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )