Skip to content

Commit ada39b5

Browse files
committed
[urtrace] print help if no command is specified
1 parent 4f51b33 commit ada39b5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/urtrace/urtrace.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,12 @@ def get_dynamic_library_name(name):
133133
if args.debug:
134134
print(env)
135135

136-
result = subprocess.run(config['command'], env=env)
137-
if args.debug:
138-
print(result)
136+
if config['command']:
137+
result = subprocess.run(config['command'], env=env)
138+
if args.debug:
139+
print(result)
140+
exit(result.returncode)
141+
else:
142+
parser.print_help()
143+
sys.exit("\n Error: Missing command to run.")
139144

140-
exit(result.returncode)

0 commit comments

Comments
 (0)