From afe985f8f2b14f0a2ca25b2aabf002554f9bd951 Mon Sep 17 00:00:00 2001 From: Serhii Yolkin Date: Tue, 3 Oct 2023 11:37:25 +0200 Subject: [PATCH] Allow passing multiple --config-include options --- dear_bindings.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dear_bindings.py b/dear_bindings.py index 0062c09..12f0f59 100644 --- a/dear_bindings.py +++ b/dear_bindings.py @@ -591,7 +591,9 @@ def convert_header( "(eg \"Imgui/\"). (default: blank)") parser.add_argument('--config-include', help="Path to additional .h file to read configuration defines from (i.e. the file you set " - "IMGUI_USER_CONFIG to, if any).") + "IMGUI_USER_CONFIG to, if any).", + default=[], + action='append') if len(sys.argv) == 1: parser.print_help(sys.stderr) @@ -605,8 +607,8 @@ def convert_header( config_include_files.append(os.path.join(os.path.dirname(os.path.realpath(args.src)), "imconfig.h")) # Add any user-supplied config file as well - if args.config_include is not None: - config_include_files.append(os.path.realpath(args.config_include)) + for config_include in args.config_include: + config_include_files.append(os.path.realpath(config_include)) # Perform conversion try: @@ -623,10 +625,9 @@ def convert_header( args.imgui_include_dir ) except: # noqa - suppress warning about broad exception clause as it's intentionally broad - raise print("Exception during conversion:") traceback.print_exc() sys.exit(1) print("Done") - sys.exit(0) + sys.exit(0) \ No newline at end of file