Commit 58af3e42 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Restore history-run functionality

parent 8029fcb9
......@@ -199,13 +199,12 @@ class Shell(Cmd):
ldescr = getattr(cls, 'long_description', '')
if subcmd.path == 'history_run':
instance = cls(
dict(cmd_parser.arguments),
dict(cmd_parser.arguments), self.auth_base,
cmd_tree=self.cmd_tree)
else:
instance = cls(
dict(cmd_parser.arguments),
self.auth_base,
self.cloud)
self.auth_base, self.cloud)
cmd_parser.update_arguments(instance.arguments)
cmd_parser.arguments = instance.arguments
cmd_parser.syntax = '%s %s' % (
......@@ -223,9 +222,7 @@ class Shell(Cmd):
for name, arg in instance.arguments.items():
arg.value = getattr(
cmd_parser.parsed,
name,
arg.default)
cmd_parser.parsed, name, arg.default)
exec_cmd(instance, cmd_parser.unparsed, help_method)
#[term for term in cmd_parser.unparsed\
......@@ -283,9 +280,7 @@ class Shell(Cmd):
empty, sep, subname = subcmd.path.partition(cmd.path)
cmd_name = '%s %s' % (cmd.name, subname.replace('_', ' '))
print('\n%s\nSyntax:\t%s %s' % (
cls.description,
cmd_name,
cls.syntax))
cls.description, cmd_name, cls.syntax))
cmd_args = {}
for arg in instance.arguments.values():
cmd_args[','.join(arg.parsed_name)] = arg.help
......
......@@ -161,7 +161,7 @@ class history_run(_init_history):
_cmd_tree = None
def __init__(self, arguments={}, auth_base=None, cmd_tree=None):
super(self.__class__, self).__init__(arguments)
super(self.__class__, self).__init__(arguments, auth_base=auth_base)
self._cmd_tree = cmd_tree
@errors.generic.all
......@@ -171,7 +171,9 @@ class history_run(_init_history):
if not cmd.is_command:
return
try:
instance = cmd.get_class()(self.arguments)
instance = cmd.get_class()(
self.arguments,
auth_base=getattr(self, 'auth_base', None))
instance.config = self.config
prs = ArgumentParseManager(
cmd.path.split(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment