[lxc-devel] [PATCH] Add --version switch to lxc-ls

Yuto KAWAMURA kawamuray.dadada at gmail.com
Tue Jul 8 01:33:41 UTC 2014


Great. Thanks!

Yuto


2014-07-07 22:57 GMT+09:00 Stéphane Graber <stgraber at ubuntu.com>:
> On Mon, Jul 07, 2014 at 08:51:47AM -0500, Serge Hallyn wrote:
>> Quoting Yuto KAWAMURA(kawamuray) (kawamuray.dadada at gmail.com):
>> > Add a global constant LXC_VERSION and --version switch to lxc-ls
>> > command for consistency with other commands.
>> >
>> > Signed-off-by: Yuto KAWAMURA(kawamuray) <kawamuray.dadada at gmail.com>
>>
>> perhaps --version should be added to the common lxc-arguments.
>
> It is, but that doesn't really help the python tools :)
>
> The patch looks mostly fine except that I'd use lxc.version rather than
> use @LXC_VERSION at . Also, the same probably ought to be done for
> lxc-device. I'll take care of that in a bit.
>
>>
>> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
>>
>> > ---
>> >  src/lxc/lxc-ls.in | 3 +++
>> >  1 file changed, 3 insertions(+)
>> >
>> > diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc-ls.in
>> > index a8f3256..776030b 100755
>> > --- a/src/lxc/lxc-ls.in
>> > +++ b/src/lxc/lxc-ls.in
>> > @@ -43,6 +43,7 @@ import encodings.ascii
>> >  assert encodings.ascii
>> >
>> >  # Constants
>> > +LXC_VERSION = "@LXC_VERSION@"
>> >  LXCPATH = "@LXCPATH@"
>> >  RUNTIME_PATH = "@RUNTIME_PATH@"
>> >
>> > @@ -119,6 +120,8 @@ parser = argparse.ArgumentParser(description=_("LXC: List containers"),
>> >  Default fancy-format fields:
>> >    %s\n""" % (", ".join(FIELDS), ", ".join(DEFAULT_FIELDS))))
>> >
>> > +parser.add_argument("--version", action="version", version=LXC_VERSION)
>> > +
>> >  parser.add_argument("-1", dest="one", action="store_true",
>> >                      help=_("list one container per line (default when piped)"))
>> >
>> > --
>> > 1.8.5.5
>> >
>> > _______________________________________________
>> > lxc-devel mailing list
>> > lxc-devel at lists.linuxcontainers.org
>> > http://lists.linuxcontainers.org/listinfo/lxc-devel
>> _______________________________________________
>> lxc-devel mailing list
>> lxc-devel at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-devel
>
> --
> Stéphane Graber
> Ubuntu developer
> http://www.ubuntu.com
>
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
>


More information about the lxc-devel mailing list