[lxc-devel] Command line syntax of utilities

Dietmar Maurer dietmar at proxmox.com
Sat Jul 18 06:30:13 UTC 2009


Another idea would be to use a single binary, and the following
command syntax:

# lxc <command> <container> [OPTIONS]

Or is there a specific reason to use multiple binaries?

- Dietmar

> -----Original Message-----
> From: Daniel Lezcano [mailto:daniel.lezcano at free.fr]
> Sent: Freitag, 17. Juli 2009 22:50
> To: Adam Majer
> Cc: Cedric Le Goater; Lxc-devel at lists.sourceforge.net
> Subject: Re: [lxc-devel] Command line syntax of utilities
> 
> Adam Majer wrote:
> > Hello,
> >
> > Is there any particular reason that ALL command line utilities that
> take
> > a container name as a required parameter, take it as part of the -n
> > parameter?
> 
> That is to make explicit the parameter name and to facilitate the
> parsing of the command line with getopt.
> 
> > Can this be simplified to work without the -n?
> > For example,
> >
> >   lxc-info -n container
> >
> > vs.
> >
> >   lxc-info container
> >
> > and [-n] becomes an implied parameter for backward compatibility.
> 
> In some cases, the parsing of the command will be tricky:
> 
> lxc-start -n debian /sbin/myinit
> =>
> lxc-start debian /sbin/myinit
> 
> lxc-execute -n foo /bin/bash
> =>
> lxc-execute foo /bin/bash
> 
> lxc-cgroup -n foo cpuset.cpus 1
> =>
> lxc-cgroup foo cpuset.cpus 1
> 
> 
> > Would patches for this be accepted?
> 
> Yes I think so, with the -n option for backward compatibility (until
> the
> 1.0.0 version is reached).
> 
> If you send the patches I will merge them after the 0.6.3 is out
> because
> I am consolidating this version right now.
> 
> Thanks
>    -- Daniel
> 






More information about the lxc-devel mailing list