From d173b2f237b1f1cf0cc2266603088c5e182a157b Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 3 Oct 2022 15:04:18 -0700 Subject: [PATCH] fix magic parser for cases where standard parser is found --- jc/cli.py | 1 + tests/test_jc_cli.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/jc/cli.py b/jc/cli.py index 7c08ba9b..f3cd7eba 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -419,6 +419,7 @@ Examples: # parser found - use standard syntax if arg.startswith('--'): + self.magic_options = [] return # option found - populate option list diff --git a/tests/test_jc_cli.py b/tests/test_jc_cli.py index 96c106f8..1678a514 100644 --- a/tests/test_jc_cli.py +++ b/tests/test_jc_cli.py @@ -24,7 +24,7 @@ class MyTests(unittest.TestCase): 'jc -a arp -a': (None, [], None), 'jc -v': (None, [], None), 'jc -h': (None, [], None), - 'jc -h --arp': (None, ['h'], None), + 'jc -h --arp': (None, [], None), 'jc -h arp': (None, [], None), 'jc -h arp -a': (None, [], None), 'jc --pretty dig': ('--dig', ['p'], ['dig']),