From 8fad06e8c83da1c197bad5970119f33e37258a5d Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Wed, 27 Feb 2019 16:54:57 +0100 Subject: rewriter: Removed python 3.7 feature required=False --- mesonbuild/rewriter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mesonbuild') diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py index 9f7c4d5..5822301 100644 --- a/mesonbuild/rewriter.py +++ b/mesonbuild/rewriter.py @@ -36,7 +36,7 @@ class RewriterException(MesonException): def add_arguments(parser, formater=None): parser.add_argument('--sourcedir', type=str, default='.', metavar='SRCDIR', help='Path to source directory.') - subparsers = parser.add_subparsers(dest='type', required=True, title='Rewriter commands', description='Rewrite command to execute') + subparsers = parser.add_subparsers(dest='type', title='Rewriter commands', description='Rewrite command to execute') # Target tgt_parser = subparsers.add_parser('target', aliases=['tgt'], help='Modify a target', formatter_class=formater) @@ -899,6 +899,11 @@ cli_type_map = { def run(options): rewriter = Rewriter(options.sourcedir) rewriter.analyze_meson() + + if options.type is None: + print('No command specified') + return 1 + commands = cli_type_map[options.type](options) if not isinstance(commands, list): -- cgit v1.1