From 199996e7b8757b6872b5064d39527fd3491d8e94 Mon Sep 17 00:00:00 2001 From: WillyPillow Date: Sat, 5 Sep 2020 02:06:53 +0800 Subject: [PATCH] qvm-template: Fix compatibility with Python 3.6 --- qubesadmin/tools/qvm_template.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qubesadmin/tools/qvm_template.py b/qubesadmin/tools/qvm_template.py index fcc3fdc..17f6530 100644 --- a/qubesadmin/tools/qvm_template.py +++ b/qubesadmin/tools/qvm_template.py @@ -58,7 +58,7 @@ def parser_gen() -> argparse.ArgumentParser: formatter = argparse.ArgumentDefaultsHelpFormatter parser_main = argparse.ArgumentParser(description='Qubes Template Manager', formatter_class=formatter) - subparsers = parser_main.add_subparsers(dest='operation', required=True, + subparsers = parser_main.add_subparsers(dest='operation', description='Command to run.') def parser_add_command(cmd, help_str): @@ -1363,6 +1363,9 @@ def main(args: typing.Optional[typing.Sequence[str]] = None, """ p_args = parser.parse_args(args) + if not p_args.operation: + parser.error('An operation needs to be specified.') + # If the user specified other repo files... if len(p_args.repo_files) > 1: # ...remove the default entry