]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shell-completion: use list-images rather than list 931/head
authorSeth Jennings <sjenning@redhat.com>
Tue, 11 Aug 2015 16:40:17 +0000 (11:40 -0500)
committerSeth Jennings <sjenning@redhat.com>
Sun, 16 Aug 2015 16:20:21 +0000 (11:20 -0500)
"machinectl list" only lists running machines while many of the MACHINES
commands use names of images; both running and non-running.

List machines from both "list" and "list-images" and use sort -u to
avoid duplicates.

shell-completion/bash/machinectl

index ad4de1789af6ab5ab0b8e115f46278ca63892ef7..0d09258a0b9cceec6b476d5caf88475df7aadfc3 100644 (file)
@@ -26,7 +26,8 @@ __contains_word() {
 
 __get_machines() {
         local a b
-        machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; };
+        (machinectl list-images --no-legend --no-pager; machinectl list --no-legend --no-pager) | \
+               { while read a b; do echo " $a"; done; } | sort -u;
 }
 
 _machinectl() {