aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES8
-rw-r--r--layman/config.py8
2 files changed, 15 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index d016bdf..f6ab303 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,14 @@
CHANGES
-------
+Version TODO
+===================================
+
+ - Handle command line calls "layman" and "layman foo" better.
+ Former now shows a usage summary while latter now reports
+ an error. Both of them kept quiet before.
+
+
Version 1.3.4 - Released 2010-07-05
===================================
diff --git a/layman/config.py b/layman/config.py
index a19d7e6..750364a 100644
--- a/layman/config.py
+++ b/layman/config.py
@@ -237,7 +237,13 @@ class Config(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
OUT.cli_handle(self.options)