Skip to content

Description strings for subcommands #214

@suntong

Description

@suntong

A descriptive message can be added at the top of the help text by implementing a Description function that returns a string.

./s-subcommands -h
this program does this and that
Usage: s-subcommands [--quiet] <command> [<args>]

Options:
  --quiet, -q
  --help, -h             display this help and exit

Commands:
  checkout
  commit
  push

Besides giving a descriptive message to the main program, please consider adding them for subcommands as well, like git:

   clone             Clone a repository into a new directory
   init              Create an empty Git repository or reinitialize an existing one

and use it for subcommand helps as well:

I.e., instead of:

 ./s-subcommands commit -h
this program does this and that
Usage: s-subcommands commit [--all] [--message MESSAGE]

Options:
  --all, -a
  --message MESSAGE, -m MESSAGE

Global options:
  --quiet, -q
  --help, -h             display this help and exit

The first line better be

commit - Record changes to the repository

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