Skip to content
This repository was archived by the owner on Sep 25, 2020. It is now read-only.
This repository was archived by the owner on Sep 25, 2020. It is now read-only.

Command help groups [moved] #26

@trentm

Description

@trentm

This is Issue 26 moved from a Google Code project.
Added by 2010-05-22T01:44:51.000Z by nil...@google.com.
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions