Skip to content
Myr

Added epilog support.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent be03257 · Browse files · 1 file+7 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−3 removed

  • other:+7 added−3 removed

1 file+7 added−3 removed

modified:click.py+7 added-3 removed
469 unmodified lines
470 :param callback: the callback to invoke. This is optional.471 :param params: the parameters to register with this command. This can472 be either :class:`Option` or :class:`Argument` objects.473 :param help: the help string to use for this command.474 :param epilog: like the help string but it's printed at the end of the475 help page after everything else.476 :param short_help: the short help to use for this command. This is477 shown on the command listing of the parent command.478 :param add_help_option: by default each command registers a ``--help``479 option. This can be disabled by this parameter.480 """481 allow_extra_args = False482483 def __init__(self, name, callback=None, params=None, help=None,482 short_help=None, options_metavar='[OPTIONS]',483 add_help_option=True):484 epilog=None, short_help=None,485 options_metavar='[OPTIONS]', add_help_option=True):486 #: the name the command things it has. Upon registering a command487 #: on a :class:`Group` the group will default the command name488 #: with this information. You should instead use the489 #: :class:`Context`\'s :attr:`~Context.info_name` attribute.
5 unmodified lines
495 #: should show up in the help page and execute. Eager parameters496 #: will automatically be handled before non eager ones.497 self.params = params or []498 self.help = help499 self.epilog = epilog500 self.options_metavar = options_metavar501 if short_help is None and help:502 short_help = help.split('.')[0].strip()503 if len(short_help) > 45:
16 unmodified lines
520 if not param.is_eager:521 yield param522523 def _make_parser(self, ctx):521 parser = _SimplifiedOptionParser(ctx, description=self.help)524 parser = _SimplifiedOptionParser(ctx, description=self.help,525 epilog=self.epilog)526 for param in self.params:527 param._add_to_parser(parser, ctx)528 return parser529
1089 unmodified lines