Skip to content

Commit 3f1b031

Browse files
Merge pull request #2 from stephane-caron/fix/cli_help
Fix command line help
2 parents 4097d0a + ea40ec8 commit 3f1b031

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

robot_descriptions/_command_line.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"""
2626

2727
import argparse
28-
import sys
2928
from functools import partial
3029
from importlib import import_module # type: ignore
3130
from typing import List
@@ -103,7 +102,7 @@ def get_argument_parser() -> argparse.ArgumentParser:
103102
"animate",
104103
help=(
105104
"animate a robot description by interpolating "
106-
"each joint between its limits",
105+
"each joint between its limits"
107106
),
108107
)
109108
parser_animate.add_argument(
@@ -205,13 +204,11 @@ def main(argv=None):
205204
"""
206205
parser = get_argument_parser()
207206
args = parser.parse_args(argv)
208-
if args.subcmd is None:
209-
parser.print_help()
210-
sys.exit(-1)
211-
212207
if args.subcmd == "list":
213208
print("\n".join(DESCRIPTION_NAMES))
214209
elif args.subcmd == "show":
215210
show(args.name, args.configuration, args.collision)
216211
elif args.subcmd == "animate":
217212
animate(args.name, args.collision, args.loop_time)
213+
else: # no subcommand
214+
parser.print_help()

0 commit comments

Comments
 (0)