Allow params starting with - (e.g. history run)
authorStavros Sachtouris <saxtouri@admin.grnet.gr>
Thu, 3 Jan 2013 16:51:33 +0000 (18:51 +0200)
committerStavros Sachtouris <saxtouri@admin.grnet.gr>
Thu, 3 Jan 2013 16:51:33 +0000 (18:51 +0200)
kamaki/cli/command_shell.py

index bc94d5c..8eff97c 100644 (file)
@@ -179,7 +179,8 @@ class Shell(Cmd):
                     cls = subcmd.get_class()
                     ldescr = getattr(cls, 'long_description', '')
                     if subcmd.path == 'history_run':
-                        instance = cls(dict(cmd_parser.arguments),
+                        instance = cls(
+                            dict(cmd_parser.arguments),
                             self.cmd_tree)
                     else:
                         instance = cls(dict(cmd_parser.arguments))
@@ -200,10 +201,12 @@ class Shell(Cmd):
                         arg.value = getattr(cmd_parser.parsed, name,
                             arg.default)
 
-                    exec_cmd(instance,
-                        [term for term in cmd_parser.unparsed\
-                            if not term.startswith('-')],
+                    exec_cmd(
+                        instance,
+                        cmd_parser.unparsed,
                         cmd_parser.parser.print_help)
+                        #[term for term in cmd_parser.unparsed\
+                        #    if not term.startswith('-')],
                 except (ClientError, CLIError) as err:
                     print_error_message(err)
             elif ('-h' in cmd_args or '--help' in cmd_args) \