Treat empty CLI args as error and show usage
This commit is contained in:
parent
0b585dee0d
commit
5bc8a878dc
@ -79,8 +79,7 @@ def prune():
|
||||
|
||||
def parse_args(args=None):
|
||||
parser = argparse.ArgumentParser(description='SPOC application manager')
|
||||
parser.set_defaults(action=None)
|
||||
subparsers = parser.add_subparsers()
|
||||
subparsers = parser.add_subparsers(dest='action', required=True)
|
||||
|
||||
parser_list = subparsers.add_parser('list')
|
||||
parser_list.set_defaults(action=listing)
|
||||
|
@ -317,6 +317,7 @@ def test_main_invalid(prune, login, stop_all, start_autostarted, status, stop, s
|
||||
['autostart', 'someapp'],
|
||||
['login'],
|
||||
['invalid'],
|
||||
[],
|
||||
])
|
||||
def test_main_systemexit(argv):
|
||||
argv.insert(0, 'foo')
|
||||
|
Loading…
Reference in New Issue
Block a user