From 6461087c865bc4af30ac8521af9db785afb662a0 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 4 Mar 2021 15:09:22 +1100 Subject: `qmk generate-rules-mk`: add `--escape` switch for makefile logic (#12101) --- lib/python/qmk/cli/generate/rules_mk.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/python/qmk') diff --git a/lib/python/qmk/cli/generate/rules_mk.py b/lib/python/qmk/cli/generate/rules_mk.py index c21ab50906..15917987b9 100755 --- a/lib/python/qmk/cli/generate/rules_mk.py +++ b/lib/python/qmk/cli/generate/rules_mk.py @@ -36,6 +36,7 @@ def process_mapping_rule(kb_info_json, rules_key, info_dict): @cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.argument('-e', '--escape', arg_only=True, action='store_true', help="Escape spaces in quiet mode") @cli.argument('-kb', '--keyboard', help='Keyboard to generate config.h for.') @cli.subcommand('Used by the make system to generate info_config.h from info.json', hidden=True) @automagic_keyboard @@ -83,7 +84,10 @@ def generate_rules_mk(cli): cli.args.output.write_text(rules_mk) if cli.args.quiet: - print(cli.args.output) + if cli.args.escape: + print(cli.args.output.as_posix().replace(' ', '\\ ')) + else: + print(cli.args.output) else: cli.log.info('Wrote rules.mk to %s.', cli.args.output) -- cgit v1.2.3