You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating help for subcommands the docstring is used verbatim. The indentation used in the code often does not make sense in the context of command help.
Example
Given a command method:
# adding help to `foo` which is in the function signature:@arg('foo', help='blah')# these are not in the signature so they go to **kwargs:@arg('baz')@arg('-q', '--quux')# the function itself:defting(foo, bar=1, *args, **kwargs):
""" Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud. """pass
Generated help:
usage: ting [-h] [-b BAR] [-q QUUX]
foo [args [args ...]] baz
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud.
positional arguments:
foo blah
[...]
Expected:
usage: ting [-h] [-b BAR] [-q QUUX]
foo [args [args ...]] baz
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud.
positional arguments:
foo blah
[...]
A possible solution may be to use the first line's indentation as a guide and remove that many characters.
The text was updated successfully, but these errors were encountered:
When generating help for subcommands the docstring is used verbatim. The indentation used in the code often does not make sense in the context of command help.
Example
Given a command method:
Generated help:
Expected:
A possible solution may be to use the first line's indentation as a guide and remove that many characters.
The text was updated successfully, but these errors were encountered: