Improve ibex_config command line handling with missing output_fn

We need to check that the output type is actually supplied, otherwise
we spit out a rather mysterious error a few lines later.
This commit is contained in:
Rupert Swarbrick 2020-11-26 08:17:29 +00:00 committed by Rupert Swarbrick
parent 86084b9d3d
commit 77d8010015

View file

@ -257,14 +257,19 @@ def main():
default=get_config_file_location())
arg_subparser = argparser.add_subparsers(
title='output type',
help='Format to output the configuration parameters in')
help='Format to output the configuration parameters in',
dest='output_fn',
metavar='output_type')
for outputter in outputters:
outputter.setup_args(arg_subparser)
args = argparser.parse_args()
if args.output_fn is None:
print('ERROR: No output format specified.')
sys.exit(1)
try:
config_file = open(args.config_filename)
config_dicts = get_config_dicts(config_file)