cwctl.py
changeset 5430 ed8f71e244f8
parent 5426 0d4853a6e5ee
child 5436 2455ca3a2a3a
--- a/cwctl.py	Wed Apr 28 12:25:11 2010 +0200
+++ b/cwctl.py	Wed Apr 28 16:13:56 2010 +0200
@@ -781,11 +781,15 @@
     repository internals (session, etc...) so most migration commands won't be
     available.
 
+    Arguments after bare "--" string will not be processed by the shell command
+    You can use it to pass extra arguments to your script and expect for
+    them in 'scriptargs' afterwards.
+
     <instance>
       the identifier of the instance to connect.
     """
     name = 'shell'
-    arguments = '<instance> [batch command file]'
+    arguments = '<instance> [batch command file(s)] [-- <script arguments>]'
     options = (
         ('system-only',
          {'short': 'S', 'action' : 'store_true',
@@ -861,8 +865,11 @@
             mih = config.migration_handler()
         try:
             if args:
-                for arg in args:
-                    mih.cmd_process_script(arg)
+                # use cmdline parser to access left/right attributes only
+                # remember that usage requires instance appid as first argument
+                scripts, args = self.cmdline_parser.largs[1:], self.cmdline_parser.rargs
+                for script in scripts:
+                    mih.cmd_process_script(script, args=args)
             else:
                 mih.interactive_shell()
         finally: