Skip to content

Commit

Permalink
add support for parameter prefixes in ros2 param list (#131)
Browse files Browse the repository at this point in the history
* add support for parameter prefix in ros2 param list

* require at least 1 prefix and simplify logic
  • Loading branch information
mikaelarguedas committed Aug 9, 2018
1 parent bffb121 commit 3aea7c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ros2param/ros2param/verb/list.py
Expand Up @@ -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='+', default=[],
help='Only list parameters with the provided prefixes')

def main(self, *, args): # noqa: D102
with NodeStrategy(args) as node:
Expand Down Expand Up @@ -64,6 +67,8 @@ def main(self, *, args): # noqa: D102
client = clients[node_name]
if client.service_is_ready():
request = ListParameters.Request()
for prefix in args.param_prefixes:
request.prefixes.append(prefix)
future = client.call_async(request)
futures[node_name] = future

Expand Down

0 comments on commit 3aea7c4

Please sign in to comment.