Commit 319300cb authored by Mathieu Giraud's avatar Mathieu Giraud

src/should.py: uppercase modifiers cancel previous regular modifiers

parent 2a858e78
Pipeline #733 failed with stages
in 1 second
......@@ -31,7 +31,8 @@ parser_mod = argparse.ArgumentParser()
for (mod_char, mod_long, mod_help) in MODIFIERS:
parser_mod.add_argument('-' + mod_char, '--' + mod_long, action='store_true', help=mod_help)
parser_mod.add_argument('-' + mod_char.upper(), dest=mod_long.replace('-', '_'), action='store_const', const=False, default=False,
help='back to default, overriding any previous -%s' % mod_char)
# Main argument parser
......@@ -88,6 +89,9 @@ class TestLine():
>>> TestLine('w2', 'o').test(['hello world'])
True
>>> TestLine('wW2', 'o').test(['hello world'])
False
>>> TestLine('wr2', 'a.c').test(['bli abc axc bla'])
True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment