multiple arguments example
authorAlexander Solovyov <piranha@piranha.org.ua>
Tue, 15 Sep 2009 19:38:41 +0300
changeset 92 979199a41678
parent 91 a0f2747f4a3d
child 93 625fd9886735
multiple arguments example
test_opts.py
--- a/test_opts.py	Sat Sep 12 08:54:47 2009 +0300
+++ b/test_opts.py	Tue Sep 15 19:38:41 2009 +0300
@@ -10,14 +10,14 @@
         ('', 'pid-file', '', 'name of file to write process ID to')]
 
 @command(opts, usage='[-l HOST] DIR')
-def main(dirname, **opts):
+def main(*dirs, **opts):
     '''This is some command
 
     It looks very similar to some serve command
     '''
     print locals()
 
-@command(usage='[-l HOST] DIR')
+@command(usage='[-l HOST] [DIR ...]')
 def another(dirname,
             listen=('l', 'localhost', 'ip to listen on'),
             port=('p', 8000, 'port to listen on'),
@@ -30,5 +30,5 @@
     print locals()
 
 if __name__ == '__main__':
-    #main()
-    another()
+    main()
+    #another()