Separate usage into usage/help/description #79

Merged
merged 1 commit into from Nov 7, 2013

3 participants

@clee704

This commit implements a clear distinction between usage, help, and
description as in the argparse module. usage shows how the command
might be executed on the command line. help is a short description
for a command. description is a longer description for a command.

Before this commit, we didn't have a way to change description without
changing usage. This could be a nuisance for someone who wanted to see
the generate usage. For instance, if we ran manage.py somecommand -h,
we've seen something like this so far:

usage: Some descriptions for the command.

optional arguments:
  -h, --help            show this help message and exit
  ...

If we added usage manually to the docstring of the command, then the
output of manage.py -h would become ugly. The only way to get around
these problems is to use diffrent variables, namely help and description.

@clee704 clee704 Separate usage into usage/help/description
This commit implements a clear distinction between usage, help, and
description as in the argparse module. usage shows how the command
might be executed on the command line. help is a short description
for a command. description is a longer description for a command.

Before this commit, we didn't have a way to change description without
changing usage. This could be a nuisance for someone who wanted to see
the generate usage. For instance, if we ran `manage.py somecommand -h`,
we've seen something like this so far:

    usage: Some descriptions for the command.

    optional arguments:
      -h, --help            show this help message and exit
      ...

If we added usage manually to the docstring of the command, then the
output of `manage.py -h` would become ugly. The only way to get around
these problems is to use diffrent variables, namely help and description.
b3e2536
@techniq techniq merged commit 62c4176 into smurfix:master Nov 7, 2013

1 check passed

Details default The Travis CI build passed
@techniq
Collaborator

Looks like a reasonable change. Thanks.

@suiwenfeng

what about description for command or option? Is it supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment