cmdln icon indicating copy to clipboard operation
cmdln copied to clipboard

Command help groups [moved]

Open trentm opened this issue 12 years ago • 3 comments

This is Issue 26 moved from a Google Code project. Added by 2010-05-22T01:44:51.000Z by [email protected]. Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Enhancement, Priority-Medium

Original description

It would be nice if cmdln supported groups for commands, such that the help 
for the tool is printed separated by sections.

Somewhat like:

class Tool(cmdln.Cmdln):
  @cmdln.section("colors")
  def do_red(...):
    ...
  ...
  @cmdln.section("metasyntactic")
  def do_foo(...):
    ...
  @cmdln.section("metasyntactic")
  def do_bar(...):
    ...
  ...

$ tool help
Usage:
    tool ...

Commands:
  colors:
    red      The red color.
    green    The green color.
    blue     The blue color.

  metasyntactic:
    foo      Does foo.
    bar      Does bar.
    baz      Does baz.

trentm avatar Sep 28 '12 04:09 trentm

I need this function. I want to implement it. Do you have any suggestions about how to implement it ?

hfeeki avatar Mar 17 '13 05:03 hfeeki

I have code it and upload it .

hfeeki avatar Mar 19 '13 16:03 hfeeki

Thanks, I will take a look as soon as I can. I'd started reviewing and it looks good so far.

trentm avatar Mar 20 '13 00:03 trentm