Revision c49188b7 kamaki/cli/commands/history.py
b/kamaki/cli/commands/history.py | ||
---|---|---|
168 | 168 |
def _run_from_line(self, line): |
169 | 169 |
terms = split_input(line) |
170 | 170 |
cmd, args = self._cmd_tree.find_best_match(terms) |
171 |
if not cmd.is_command: |
|
172 |
return |
|
173 |
try: |
|
174 |
instance = cmd.cmd_class( |
|
175 |
self.arguments, |
|
176 |
auth_base=getattr(self, 'auth_base', None)) |
|
177 |
instance.config = self.config |
|
178 |
prs = ArgumentParseManager( |
|
179 |
cmd.path.split(), |
|
180 |
dict(instance.arguments)) |
|
181 |
prs.syntax = '%s %s' % ( |
|
182 |
cmd.path.replace('_', ' '), |
|
183 |
cmd.cmd_class.syntax) |
|
184 |
prs.parse(args) |
|
185 |
exec_cmd(instance, prs.unparsed, prs.parser.print_help) |
|
186 |
except (CLIError, ClientError) as err: |
|
187 |
print_error_message(err, self._err) |
|
188 |
except Exception as e: |
|
189 |
self.error('Execution of [ %s ] failed\n\t%s' % (line, e)) |
|
171 |
if cmd.is_command: |
|
172 |
try: |
|
173 |
instance = cmd.cmd_class( |
|
174 |
self.arguments, auth_base=getattr(self, 'auth_base', None)) |
|
175 |
instance.config = self.config |
|
176 |
prs = ArgumentParseManager( |
|
177 |
cmd.path.split(), dict(instance.arguments)) |
|
178 |
prs.syntax = '%s %s' % ( |
|
179 |
cmd.path.replace('_', ' '), cmd.cmd_class.syntax) |
|
180 |
prs.parse(args) |
|
181 |
exec_cmd(instance, prs.unparsed, prs.parser.print_help) |
|
182 |
except (CLIError, ClientError) as err: |
|
183 |
print_error_message(err, self._err) |
|
184 |
except Exception as e: |
|
185 |
self.error('Execution of [ %s ] failed\n\t%s' % (line, e)) |
|
190 | 186 |
|
191 | 187 |
@errors.generic.all |
192 | 188 |
@errors.history._get_cmd_ids |
Also available in: Unified diff