bench-boot: start convert to cli function

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-22 00:00:00 +00:00
parent 9acbcaaa5b
commit c2983e0e1f
4 changed files with 121 additions and 88 deletions

View File

@@ -431,6 +431,8 @@ amazing function!
assert one_cli_function.get_cli(pos_mandatory=1, bool=False) == [('--bool',), ('--bool-cli',), ('1',)]
assert one_cli_function.get_cli(pos_mandatory=1, pos_optional=2, args_star=['3', '4']) == [('--bool-cli',), ('1',), ('2',), ('3',), ('4',)]
assert one_cli_function.get_cli(pos_mandatory=1, append=['2', '3']) == [('--append', '2'), ('--append', '3',), ('--bool-cli',), ('1',)]
print(one_cli_function.get_cli(pos_mandatory=1, args_star=['asdf', 'qwer']))
assert one_cli_function.get_cli(pos_mandatory=1, args_star=['asdf', 'qwer']) == [('--bool-cli',), ('1',), ('asdf',), ('qwer',),]
if len(sys.argv) > 1:
# CLI call with argv command line arguments.