shell-completion: use list-images rather than list

"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.
This commit is contained in:
Seth Jennings 2015-08-11 11:40:17 -05:00
parent 6eb8bec62d
commit 4f8f4c310c
1 changed files with 2 additions and 1 deletions

View 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() {