]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Remind the optparse CLI about `extract -s` (a shorthand for `--strip-comments`)
authorAarni Koskela <akx@iki.fi>
Sun, 17 Apr 2016 15:06:03 +0000 (18:06 +0300)
committerAarni Koskela <akx@iki.fi>
Tue, 19 Apr 2016 18:29:09 +0000 (21:29 +0300)
Fixes #390

babel/messages/frontend.py
tests/messages/test_frontend.py

index 2a4f1846f363245535d36312a7c364366f20bb45..ee1e1855e7cb64a562fd186b13fd910904ca7f56 100644 (file)
@@ -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 '
index ad938ace8032795b55d76207c448fb24aab93d21..26f6cce1929c08484e81611a54f1d7bdc95a6a26 100644 (file)
@@ -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