From: Aarni Koskela Date: Sun, 17 Apr 2016 15:06:03 +0000 (+0300) Subject: Remind the optparse CLI about `extract -s` (a shorthand for `--strip-comments`) X-Git-Tag: v2.4.0~28^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb06614d16b2fd8154ec69370d905177d99c16fa;p=thirdparty%2Fbabel.git Remind the optparse CLI about `extract -s` (a shorthand for `--strip-comments`) Fixes #390 --- diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py index 2a4f1846..ee1e1855 100644 --- a/babel/messages/frontend.py +++ b/babel/messages/frontend.py @@ -297,7 +297,7 @@ class extract_messages(Command): ('add-comments=', 'c', 'place comment block with TAG (or those preceding keyword lines) in ' 'output file. Separate multiple TAGs with commas(,)'), # TODO: Support repetition of this argument - ('strip-comments', None, + ('strip-comments', 's', 'strip the comment TAGs from the comments.'), ('input-paths=', None, 'files or directories that should be scanned for messages. Separate multiple ' diff --git a/tests/messages/test_frontend.py b/tests/messages/test_frontend.py index ad938ace..26f6cce1 100644 --- a/tests/messages/test_frontend.py +++ b/tests/messages/test_frontend.py @@ -1343,3 +1343,10 @@ def test_update_catalog_boolean_args(): assert cmdinst.no_fuzzy_matching is True assert cmdinst.ignore_obsolete is True assert cmdinst.previous is False # Mutually exclusive with no_fuzzy_matching + + +def test_extract_cli_knows_dash_s(): + # This is a regression test for https://github.com/python-babel/babel/issues/390 + cmdinst = configure_cli_command("extract -s -o foo babel") + assert isinstance(cmdinst, extract_messages) + assert cmdinst.strip_comments