Show help banner if no command given

This commit is contained in:
Aanand Prasad 2013-12-20 12:09:07 +00:00
parent 791028866c
commit 3bebd18de7
1 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,9 @@ class DocoptCommand(object):
options = docopt_full_help(getdoc(self), argv, **self.docopt_options())
command = options['COMMAND']
if command is None:
raise SystemExit(getdoc(self))
if not hasattr(self, command):
raise NoSuchCommand(command, self)