diff options
Diffstat (limited to 'layman/config.py')
-rw-r--r-- | layman/config.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/layman/config.py b/layman/config.py index 71cf97b..e62f535 100644 --- a/layman/config.py +++ b/layman/config.py @@ -40,10 +40,9 @@ from layman.version import VERSION #------------------------------------------------------------------------------- _USAGE = """ - -layman (-a|-d|-s|-i) OVERLAY -layman -f [-o URL] -layman (-l|-L|-S)""" + layman (-a|-d|-s|-i) (OVERLAY|ALL) + layman -f [-o URL] + layman (-l|-L|-S)""" class BareConfig(object): '''Handles the configuration only.''' @@ -315,7 +314,13 @@ class ArgsParser(object): # Parse the command line first since we need to get the config # file option. - self.options = self.parser.parse_args(args)[0] + if len(args) == 1: + print 'Usage:%s' % _USAGE + sys.exit(0) + + (self.options, remain_args) = self.parser.parse_args(args) + if len(remain_args) > 1: # remain_args starts with something like "bin/layman" ... + self.parser.error("Unhandled parameters: %s" % ', '.join(('"%s"' % e) for e in remain_args[1:])) # handle debugging self.output.cli_handle(self.options) |