diff --git a/sros2/sros2/command/security.py b/sros2/sros2/command/security.py index 23e3eb2f..02ff5b82 100644 --- a/sros2/sros2/command/security.py +++ b/sros2/sros2/command/security.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ros2cli.command import add_subparsers +from ros2cli.command import add_subparsers_on_demand from ros2cli.command import CommandExtension -from ros2cli.verb import get_verb_extensions class SecurityCommand(CommandExtension): @@ -23,8 +22,8 @@ class SecurityCommand(CommandExtension): def add_arguments(self, parser, cli_name): self._subparser = parser # get verb extensions and let them add their arguments - verb_extensions = get_verb_extensions('sros2.verb') - add_subparsers(parser, cli_name, '_verb', verb_extensions, required=False) + add_subparsers_on_demand( + parser, cli_name, '_verb', 'sros2.verb', required=False) def main(self, *, parser, args): if not hasattr(args, '_verb'):