diff --git a/setup.py b/setup.py index 03ba4db..8469216 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ def long_desc(): setup( name='shellish', - version='5', + version='5.1', description='A framework for CLI/shell programs.', author='Justin Mayfield', author_email='tooker@gmail.com', @@ -33,15 +33,14 @@ def long_desc(): ] }, classifiers=[ - 'Development Status :: 4 - Beta', - # 'Development Status :: 5 - Production/Stable', - # 'Development Status :: 6 - Mature', + 'Development Status :: 6 - Mature', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.11', 'Topic :: Software Development :: Libraries', 'Topic :: System :: Shells', ] diff --git a/shellish/command/autocommand.py b/shellish/command/autocommand.py index f28f0b0..b272509 100644 --- a/shellish/command/autocommand.py +++ b/shellish/command/autocommand.py @@ -67,7 +67,7 @@ def setup_args(self, default_parser): param.KEYWORD_ONLY): if param.kind == param.KEYWORD_ONLY or \ param.default is not sig.empty: - name = '--%s' % name + name = '--%s' % name.replace('_', '-') label = 'keyword' got_keywords = True else: @@ -86,7 +86,7 @@ def setup_args(self, default_parser): label = 'varargs' elif param.kind == param.VAR_KEYWORD: options['nargs'] = argparse.REMAINDER - name = '--%s' % name + name = '--%s' % name.replace('_', '-') label = 'varkwargs' help = 'variable key/value args [[--key value] || ' \ '[key=value] ...]' @@ -102,12 +102,7 @@ def setup_args(self, default_parser): del options['type'] else: options['type'] = lambda x: x.lower() not in self.falsy - else: - try: - options['metavar'] = options['type'].__name__.upper() - except: - pass - action = parser.add_argument(name.replace('_', '-'), **options) + action = parser.add_argument(name, **options) action.label = label diff --git a/shellish/command/supplement.py b/shellish/command/supplement.py index aeacb6d..9f2469c 100644 --- a/shellish/command/supplement.py +++ b/shellish/command/supplement.py @@ -314,9 +314,9 @@ def format_help(self): title, about = '', desc else: title, about = self.description, '' - if title: + if title and title.strip(): formatter.add_text('%s\n' % title.strip()) - if about: + if about and about.rstrip(): formatter.add_text(about.rstrip()) for group in self._action_groups: formatter.start_section(group.title)