~brenns10/subc

eb19dfa351c8340b8b619cc385be9184992e0ddf — Stephen Brennan 1 year, 5 months ago 18c8928 master v0.6.0
Supply help="...", v0.6.0
3 files changed, 11 insertions(+), 1 deletions(-)

M CHANGELOG.md
M setup.py
M subc/__init__.py
M CHANGELOG.md => CHANGELOG.md +9 -0
@@ 4,6 4,15 @@ Changelog
Unreleased
----------

0.6.0
-----

- A "not breaking" but kinda still big change: Command subclasses may supply a
  "help" attribute which is passed to the help argument of `add_parser()`. If it
  is not provided, then the class's description attribute is used. This means
  that the `-h` output of the tool should provide a listing of subcommands, one
  per line, with a description (taken from the `help` kwarg) of that subcommand.

0.5.0
-----


M setup.py => setup.py +1 -1
@@ 4,7 4,7 @@ long_description = open('README.rst').read()

setup(
    name='subc',
    version='0.5.0',
    version='0.6.0',
    description='CLI sub-command library',
    long_description=long_description,
    url='https://git.sr.ht/~brenns10/subc',

M subc/__init__.py => subc/__init__.py +1 -0
@@ 196,6 196,7 @@ class Command(ABC):
        for cmd in to_add:
            cmd_parser = subparsers.add_parser(
                cmd.name, description=cmd.description,
                help=getattr(cmd, "help", cmd.description),
            )
            cmd.add_args(cmd_parser)
            cmd_parser.set_defaults(func=cmd.base_run)