Align parsed() call with cmd2 versions >= 0.7.3
In version 0.7.3, cmd2 moved the parsed method from class Cmd() to class ParserManager(). Change-Id: Ie0c057ffaeaa05c4f5e0f3599aab850245c55066 Closes-Bug: #1751822
This commit is contained in:
parent
be3c326f55
commit
8416650128
|
@ -111,7 +111,13 @@ class InteractiveApp(cmd2.Cmd):
|
||||||
# Dispatch to the underlying help command,
|
# Dispatch to the underlying help command,
|
||||||
# which knows how to provide help for extension
|
# which knows how to provide help for extension
|
||||||
# commands.
|
# commands.
|
||||||
self.default(self.parsed('help ' + arg))
|
try:
|
||||||
|
# NOTE(coreycb): This try path can be removed once
|
||||||
|
# requirements.txt has cmd2 >= 0.7.3.
|
||||||
|
parsed = self.parsed
|
||||||
|
except AttributeError:
|
||||||
|
parsed = self.parser_manager.parsed
|
||||||
|
self.default(parsed('help ' + arg))
|
||||||
else:
|
else:
|
||||||
cmd2.Cmd.do_help(self, arg)
|
cmd2.Cmd.do_help(self, arg)
|
||||||
cmd_names = sorted([n for n, v in self.command_manager])
|
cmd_names = sorted([n for n, v in self.command_manager])
|
||||||
|
|
Loading…
Reference in New Issue