Allow examples to be written for a command/subcommand that can be requested with the -e or --example flag to the help command. Examples are useful for complicated commands like quote.
!help -e foo
Output:
- Perform foo on bar: `!foo bar`
- Perform foo on bar with biz: `!foo --method biz bar`
Can add this functionality to our CommandParser class:
Add an examples attribute; it may be a single free-form string, or a list of 2-tuples holding a prose description and the corresponding command invocation
Maybe encapsulate this into a CommandExample class?
Extend argparse's argument class to accept an example argument when adding arguments?
Alternatively, add them at the end with a CommandParser method.
Allow examples to be written for a command/subcommand that can be requested with the
-e
or--example
flag to thehelp
command. Examples are useful for complicated commands likequote
.Can add this functionality to our
CommandParser
class:examples
attribute; it may be a single free-form string, or a list of 2-tuples holding a prose description and the corresponding command invocationCommandExample
class?argparse
's argument class to accept anexample
argument when adding arguments?CommandParser
method.