In ros2topic/ros2topic/verb/pub.py, the help text for --max-wait-time-secs refers to --wait-until-matching-subscriptions, which does not exist. The actual argument name is --wait-matching-subscriptions.
Modify the following file to fix the option name in the help text:
ros2topic/ros2topic/verb/pub.py
Example: How to fix the help text
# Before:
parser.add_argument(
'--max-wait-time-secs',
dest='max_wait_time_secs', type=positive_float, default=None,
help='This sets the maximum wait time in seconds if '
'--wait-until-matching-subscriptions is set. '
'By default, this flag is not set meaning the subscriber will wait endlessly.')
# After:
parser.add_argument(
'--max-wait-time-secs',
dest='max_wait_time_secs', type=positive_float, default=None,
help='This sets the maximum wait time in seconds if '
'--wait-matching-subscriptions is set. '
'By default, this flag is not set meaning the subscriber will wait endlessly.')
Example: How to add a test
Add a test in ros2topic/test/ that checks the generated help output of PubVerb:
import argparse
from ros2topic.verb.pub import PubVerb
def test_pub_help_mentions_wait_matching_subscriptions():
parser = argparse.ArgumentParser()
verb = PubVerb()
verb.add_arguments(parser, 'ros2 topic pub')
help_text = parser.format_help()
assert '--wait-matching-subscriptions' in help_text
assert '--wait-until-matching-subscriptions' not in help_text
In
ros2topic/ros2topic/verb/pub.py, the help text for--max-wait-time-secsrefers to--wait-until-matching-subscriptions, which does not exist. The actual argument name is--wait-matching-subscriptions.Modify the following file to fix the option name in the help text:
ros2topic/ros2topic/verb/pub.pyExample: How to fix the help text
Example: How to add a test
Add a test in
ros2topic/test/that checks the generated help output ofPubVerb: