[Freeipa-devel] [PATCH] 203 Add argument help to CLI

Martin Kosek mkosek at redhat.com
Tue Jan 31 14:38:30 UTC 2012


On Mon, 2012-01-30 at 11:22 -0500, Rob Crittenden wrote:
> Martin Kosek wrote:
> > An example of the improved help:
> >
> > # ipa help user-add
> > Purpose: Add a new user.
> > Usage: ipa [global-options] user-add LOGIN [options]
> >
> > Positional arguments:
> > LOGIN: User login
> >
> > Options:
> >    -h, --help         show this help message and exit
> >    --first=STR        First name
> >    --last=STR         Last name
> >    --cn=STR           Full name
> > ...
> >
> >
> > We may want to improve help for most arguments we use. Most of them are
> > missing. In this patch I updated just the CRITERIA argument that was
> > complained about in the relevant BZ.
> >
> > Martin
> 
> Patch looks ok, I just think the output could be improved.
> 
> I think it should look similar to the existing usage output, so, similar 
> indention and description columns lined up:
> 
> Usage: ipa [global-options] user-add LOGIN [options]
> 
> Positional arguments:
>    LOGIN              User login
> 
> Options:
>    -h, --help         show this help message and exit
> 
> rob

I agree. I refactored the patch to integrate better with OptionParser
and rather provide a support of argument help directly instead of
misusing description field.

New patch adds a formatter capable of formatting arguments consistently
with options format (as you proposed).

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-mkosek-203-2-add-argument-help-to-cli.patch
Type: text/x-patch
Size: 5799 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120131/5b02d171/attachment.bin>


More information about the Freeipa-devel mailing list