Skip to content

Commit

Permalink
handle none value for the subcommand parser (#2276)
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterxgchen authored Jan 12, 2024
1 parent 6bd1ed5 commit c806e1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nvflare/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ def parse_args(prog_name: str):
if argv:
msg = f"{prog_name} {cmd}: unrecognized arguments: {' '.join(argv)}\n"
print(f"\nerror: {msg}")
sub_cmd_parser.print_help()
if sub_cmd_parser:
sub_cmd_parser.print_help()
_parser.exit(2, "\n")
return _parser, _parser.parse_args(), sub_cmd_parsers

Expand Down

0 comments on commit c806e1e

Please sign in to comment.