cbc-apitool: print usage instead of crashing if no subcmd passed

The "required" param was added in python 3.7.

Change-Id: Ia8d13beeb8da64644d1aaf36deeddda4de889a6c
This commit is contained in:
Pau Espin 2022-07-22 18:20:17 +02:00
parent 01338add1d
commit 028b48b967
1 changed files with 1 additions and 1 deletions

View File

@ -117,7 +117,7 @@ def main(argv):
parser.add_argument("-p", "--port", help="TCP port to connect to", type=int, default=12345)
parser.add_argument("-v", "--verbose", help="increase output verbosity", action='count', default=0)
subparsers = parser.add_subparsers()
subparsers = parser.add_subparsers(required=True)
parser_c_cbs = subparsers.add_parser('create-cbs', help='Create a new CBS message')
parser_c_cbs.add_argument("--msg-id", type=int, help='Message Identifier', required=True)