[systemd-devel] [PATCH 1/3] zsh-completion: add missing completions for machinectl

Lennart Poettering lennart at poettering.net
Wed Apr 22 11:20:58 PDT 2015


On Wed, 22.04.15 11:07, Lukas Rusak (lorusak at gmail.com) wrote:

> ---
>  shell-completion/zsh/_machinectl | 84 +++++++++++++++++++++++++++++++++-------
>  1 file changed, 70 insertions(+), 14 deletions(-)
> 
> diff --git a/shell-completion/zsh/_machinectl b/shell-completion/zsh/_machinectl
> index c666b7e..2b1b7ed 100644
> --- a/shell-completion/zsh/_machinectl
> +++ b/shell-completion/zsh/_machinectl
> @@ -1,5 +1,20 @@
>  #compdef machinectl
>  
> +__get_available_machines () {
> +    ls -1 /var/lib/container |  {while read -r a b; do echo $a; done;}
> +}

Hmm, the right way to list running containers is with "machinectl
list". The right way to list container images is with "machinectl
list-images".

Just listing /var/lib/container is not right, because the we tent to
prefer /var/lib/machines now, and because we support raw images in
those dirs, which carry the ".raw" suffix which should be removed when
used as machine name.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list