New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for parameter prefixes in ros2 param list #131
Conversation
fb3ac5d
to
e654c3e
Compare
ros2param/ros2param/verb/list.py
Outdated
@@ -46,6 +49,9 @@ def main(self, *, args): # noqa: D102 | |||
if args.node_name not in node_names: | |||
return 'Node not found' | |||
node_names = [args.node_name] | |||
param_prefixes = [] | |||
if args.param_prefixes is not None: | |||
param_prefixes = [args.param_prefixes] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this always be a list of 1?
ros2param/ros2param/verb/list.py
Outdated
@@ -36,6 +36,9 @@ def add_arguments(self, parser, cli_name): # noqa: D102 | |||
parser.add_argument( | |||
'--include-hidden-nodes', action='store_true', | |||
help='Consider hidden nodes as well') | |||
parser.add_argument( | |||
'--param-prefixes', nargs='?', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure nargs='?'
is the right choice because it allows an empty --param-prefixes
$ ros2 param list --param-prefixes
listener:
bar.baz
foo
foo.bar
foo.bar.baz
Is the intent to allow multiple prefixes to be specified? If so, nargs='+'
or action='append'
might be better choices.
Thanks for the feedback, I simplified the logic in c67f9d8 and it should now support multiple prefixes |
No description provided.