Switch from add_subparsers to add_subparsers_on_demand
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
This commit is contained in:
parent
936fc31dca
commit
e757a98554
1 changed files with 3 additions and 5 deletions
|
@ -14,9 +14,8 @@
|
||||||
|
|
||||||
"""Module for trace analysis command extension implementation."""
|
"""Module for trace analysis command extension implementation."""
|
||||||
|
|
||||||
from ros2cli.command import add_subparsers
|
from ros2cli.command import add_subparsers_on_demand
|
||||||
from ros2cli.command import CommandExtension
|
from ros2cli.command import CommandExtension
|
||||||
from ros2cli.verb import get_verb_extensions
|
|
||||||
|
|
||||||
|
|
||||||
class TraceAnalysisCommand(CommandExtension):
|
class TraceAnalysisCommand(CommandExtension):
|
||||||
|
@ -25,9 +24,8 @@ class TraceAnalysisCommand(CommandExtension):
|
||||||
def add_arguments(self, parser, cli_name):
|
def add_arguments(self, parser, cli_name):
|
||||||
self._subparser = parser
|
self._subparser = parser
|
||||||
# get verb extensions and let them add their arguments
|
# get verb extensions and let them add their arguments
|
||||||
verb_extensions = get_verb_extensions('ros2trace_analysis.verb')
|
add_subparsers_on_demand(
|
||||||
add_subparsers(
|
parser, cli_name, '_verb', 'ros2trace_analysis.verb', required=False)
|
||||||
parser, cli_name, '_verb', verb_extensions, required=False)
|
|
||||||
|
|
||||||
def main(self, *, parser, args):
|
def main(self, *, parser, args):
|
||||||
if not hasattr(args, '_verb'):
|
if not hasattr(args, '_verb'):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue