--- a/finaloption.py Fri Aug 07 16:47:17 2009 +0300
+++ b/finaloption.py Fri Aug 07 16:47:36 2009 +0300
@@ -124,8 +124,7 @@
lambda: call_cmd(name, middleware(func), *args, **kwargs),
help_func)
except Abort:
- pass
- return -1
+ return -1
# --------
# Help
@@ -267,6 +266,9 @@
if short and len(short) != 1:
raise FOError('Short option should be only a single'
' character: %s' % short)
+ if not name:
+ raise FOError(
+ 'Long name should be defined for every option')
# change name to match Python styling
pyname = name.replace('-', '_')
argmap['-' + short] = argmap['--' + name] = pyname
--- a/test_cmd.py Fri Aug 07 16:47:17 2009 +0300
+++ b/test_cmd.py Fri Aug 07 16:47:36 2009 +0300
@@ -16,10 +16,9 @@
('p', 'port', 5000, 'The port for the server.'),
('', 'nolint', False, 'Do not use LintMiddleware')
])
-def runserver(config, host, port, nolint):
+def runserver(**opts):
"""Run development server"""
-
- pass
+ print opts
finaloption.dispatch()