diff --git a/cliff/help.py b/cliff/help.py index 2a235def..af30504d 100644 --- a/cliff/help.py +++ b/cliff/help.py @@ -75,7 +75,7 @@ class HelpAction(argparse.Action): if namespace.debug: traceback.print_exc(file=out) continue - one_liner = cmd.get_description().split('\n')[0] + one_liner = cmd.get_description().split('\n')[0].rstrip('.') dist_name = dist_for_obj(factory) if dist_name and dist_name != app_dist: dist_info = ' (' + dist_name + ')' diff --git a/cliff/tests/test_help.py b/cliff/tests/test_help.py index 4862f259..c9b0c8b0 100644 --- a/cliff/tests/test_help.py +++ b/cliff/tests/test_help.py @@ -103,8 +103,8 @@ class TestHelp(base.TestBase): self.assertIn('usage: %s [--version]' % basecommand, help_text) self.assertRegex(help_text, 'option(s|al arguments):\n --version') expected = ( - ' one Test command.\n' - ' three word command Test command.\n' + ' one Test command\n' + ' three word command Test command\n' ) self.assertIn(expected, help_text) diff --git a/releasenotes/notes/strip-period-from-help-strings-be368e5cf5bd5269.yaml b/releasenotes/notes/strip-period-from-help-strings-be368e5cf5bd5269.yaml new file mode 100644 index 00000000..9577e910 --- /dev/null +++ b/releasenotes/notes/strip-period-from-help-strings-be368e5cf5bd5269.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Trailing periods will now be stripped from the oneline summary shown + for the help command. This better aligns with the format used by + argparse itself.