]> git.proxmox.com Git - mirror_lxc.git/commit
lxc-ls: Don't exit 1 when no container or help
authorStéphane Graber <stgraber@ubuntu.com>
Mon, 12 Nov 2012 21:20:53 +0000 (16:20 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 12 Nov 2012 21:20:53 +0000 (16:20 -0500)
commitaeb958be832011009226b39e04d61cfb2a6e7da3
treeb87c0f02fdb7c3caee2f833e38e2b745460ca439
parent9b106331e79de6dc328b5545b4b188b527224dee
lxc-ls: Don't exit 1 when no container or help

lxc-ls is currently exiting with return code 1 when called with --help
or when called on a system without containers.

This behaviour isn't documented in the manpage and isn't terribly intuitive.
It's been the source of quite a few weird failures in scripts running with
set -e.

As a user calling --help is a voluntary action, lxc-ls should exit 0.

Also, as lxc-ls's goal is solely to list containers, showing an error and
exiting with return code 1 when there's no container seems counter-intuitive
and error-prone.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxc-ls.in