config: Print usage if no subcommand is given.
This commit is contained in:
parent
b1fda6a647
commit
c8000a8a74
1 changed files with 3 additions and 0 deletions
|
@ -40,6 +40,9 @@ class Configuration:
|
||||||
if read_path != expected_path:
|
if read_path != expected_path:
|
||||||
self.error("failed to read configuration file {!r}".format(expected_path))
|
self.error("failed to read configuration file {!r}".format(expected_path))
|
||||||
|
|
||||||
|
if not hasattr(self.args, 'command'):
|
||||||
|
argparser.print_help()
|
||||||
|
exit(2)
|
||||||
try:
|
try:
|
||||||
post_hook = getattr(self, '_post_hook_' + self.args.command)
|
post_hook = getattr(self, '_post_hook_' + self.args.command)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
Loading…
Reference in a new issue