<div dir="ltr"><div style="font-size:12.8000001907349px">Ah, completely missed images. So perhaps something like this would be better?<br></div><div style="font-size:12.8000001907349px"><p>machinectl --full --no-legend --no-pager list-images | awk '{print $1}' </p><p>as this lists<br></p><p>fedora<br>fedora-rawhide</p><p>instead of<br></p><p>fedora.raw<br>fedora-rawhide</p><p>However this will break if one has spaces in the container name. I would delimit awk by a tab, but it seems list-images doesn't delimit by tabs. So I'm not sure what the best solution would be as something like this, "ls -1 /var/lib/container | sed 's|\.raw||g'" seems kind of silly.</p><p>(Apologies for sending twice. I missed the CC)</p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 22, 2015 at 11:20 AM, Lennart Poettering <span dir="ltr"><<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, 22.04.15 11:07, Lukas Rusak (<a href="mailto:lorusak@gmail.com">lorusak@gmail.com</a>) wrote:<br>
<br>
> ---<br>
>  shell-completion/zsh/_machinectl | 84 +++++++++++++++++++++++++++++++++-------<br>
>  1 file changed, 70 insertions(+), 14 deletions(-)<br>
><br>
> diff --git a/shell-completion/zsh/_machinectl b/shell-completion/zsh/_machinectl<br>
> index c666b7e..2b1b7ed 100644<br>
> --- a/shell-completion/zsh/_machinectl<br>
> +++ b/shell-completion/zsh/_machinectl<br>
> @@ -1,5 +1,20 @@<br>
>  #compdef machinectl<br>
><br>
> +__get_available_machines () {<br>
> +    ls -1 /var/lib/container |  {while read -r a b; do echo $a; done;}<br>
> +}<br>
<br>
</span>Hmm, the right way to list running containers is with "machinectl<br>
list". The right way to list container images is with "machinectl<br>
list-images".<br>
<br>
Just listing /var/lib/container is not right, because the we tent to<br>
prefer /var/lib/machines now, and because we support raw images in<br>
those dirs, which carry the ".raw" suffix which should be removed when<br>
used as machine name.<br>
<span class="HOEnZb"><font color="#888888"><br>
Lennart<br>
<br>
--<br>
Lennart Poettering, Red Hat<br>
</font></span></blockquote></div><br></div>