[Rubygems-developers] New command-line help approach

Ryan Leavengood mrcode1234 at yahoo.com
Thu May 6 16:39:45 EDT 2004

I agree with Michael.  His examples are also a lot like the Perforce
command-line program, called p4, which I think is quite well designed.  The
first parameter is always a command:

   p4 edit <some_file>           # edit a file
   p4 describe -s <some_change>  # describe a change in a short format
   p4 help                       # show general p4 help
   p4 help commands              # show generic help on the commands
   p4 help edit                  # show specific help on the edit command

Each command has its own options which come between the command name and the
normal command parameters (like in describe above.)  Running the 'p4' command
by itself shows the same output as 'p4 help'.

This would be pretty easy to implement, just using a case for the command part,
then maybe seperate optparse objects for each command's options/parameters.


--- Michael Neumann <mneumann at ntecs.de> wrote:
> Personally I'd like it more this way:
>   gem help       # display help
>   gem list       # invoke the "list" command (--list)
>   gem help list  # show the help of the list command
>   gem install RedCloth-0-0-1
> The basic commands like "list", "install" etc. are given without "--",
> only special options (like http-proxy) which are themself no commands
> are given with "--". This distinguishes commands from options.
> But I really haven't thought this out, just a raw idea (inspired from
> OpenCM command line).
> Regards,
>   Michael

Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

More information about the Rubygems-developers mailing list