Commit 155db74b authored by ∞'s avatar 💻

Add parser.dashall, for argument proxying

parent af6d2d7d
Pipeline #2175 passed with stages
in 44 seconds
......@@ -71,9 +71,10 @@ def debug(callback, *args, **kwargs):
Callable: {RED}{callback}{RESET}
Args: {YELLOW}{args}{RESET}
Kwargs: {YELLOW}{kwargs}{RESET}
console_script.parser.options: {GREEN}{parser.options}{RESET}
console_script.parser.dashargs: {GREEN}{parser.dashargs}{RESET}
console_script.parser.dashkwargs: {GREEN}{parser.dashkwargs}{RESET}
console_script.parser.options: {GREEN}{parser.options}{RESET}
console_script.parser.dashall: {GREEN}{parser.dashall}{RESET}
''').strip()
......
......@@ -13,6 +13,7 @@ class Parser:
self.funckwargs = {}
self.dashargs = []
self.dashkwargs = {}
self.dashall = []
self.options = {}
def parse(self):
......@@ -52,6 +53,7 @@ class Parser:
self.options[option.name] = value
else:
self.dashkwargs[key] = value
self.dashall.append(arg)
else:
key, value = arg.split('=', 1)
self.funckwargs[key] = value
......@@ -64,5 +66,6 @@ class Parser:
self.options[option.name] = True
else:
self.dashargs.append(stripped)
self.dashall.append(arg)
else:
self.funcargs.append(arg)
......@@ -4,6 +4,7 @@ stdout:
Callable: cli2.run
Args: ('to',)
Kwargs: {'see': 'how'}
console_script.parser.options: {}
console_script.parser.dashargs: ['it']
console_script.parser.dashkwargs: {'parses': 'me'}
console_script.parser.options: {}
console_script.parser.dashall: ['-it', '--parses=me']
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