Skip to content

Commit 448846d

Browse files
authored
Add --show-all-subprocesses-output command line option. (#10)
* Add --show-all-subprocesses-output command line option. Implemented using the $OVERRIDE_LAUNCH_PROCESS_OUTPUT envvar. Signed-off-by: Michel Hidalgo <[email protected]> * Address peer review comments. Signed-off-by: Michel Hidalgo <[email protected]>
1 parent 1340fc8 commit 448846d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ros2launch/ros2launch/command/launch.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ def add_arguments(self, parser, cli_name):
4444
command_group.add_argument(
4545
'-s', '--show-args', '--show-arguments', default=False, action='store_true',
4646
help='Show arguments that may be given to the launch file.')
47+
parser.add_argument(
48+
'-a', '--show-all-subprocesses-output', default=False, action='store_true',
49+
help=('Show all launched subprocesses\' output by overriding their output'
50+
' configuration using the OVERRIDE_LAUNCH_PROCESS_OUTPUT envvar.')
51+
)
4752
arg = parser.add_argument(
4853
'package_name',
4954
help='Name of the ROS package which contains the launch file')
@@ -105,6 +110,8 @@ def main(self, *, parser, args):
105110
raise RuntimeError('unexpected mode')
106111
launch_arguments.extend(args.launch_arguments)
107112
try:
113+
if args.show_all_subprocesses_output:
114+
os.environ['OVERRIDE_LAUNCH_PROCESS_OUTPUT'] = 'both'
108115
if args.print:
109116
return print_a_python_launch_file(python_launch_file_path=path)
110117
elif args.show_args:

0 commit comments

Comments
 (0)