west_commands: bindesc: Fixed crash when no sub-command is given

The west bindesc command currently crashes when no subcommand is
given. This is because the subcommand was not marked as required.
This commit fixes the issue.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
This commit is contained in:
Yonatan Schachter 2023-09-28 15:36:40 +03:00 committed by Johan Hedberg
commit 66c4cef240

View file

@ -111,7 +111,7 @@ class Bindesc(WestCommand):
help=self.help,
description=self.description)
subparsers = parser.add_subparsers(help='sub-command to run')
subparsers = parser.add_subparsers(help='sub-command to run', required=True)
dump_parser = subparsers.add_parser('dump', help='Dump all binary descriptors in the image')
dump_parser.add_argument('file', type=str, help='Executable file')