From 23d7dfb97189b3e29f285cccdda2dff55545a5b5 Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Mon, 9 Sep 2024 17:08:58 -0700 Subject: [PATCH] switch command line argument to specify input file to -i --- Makefile | 4 ++-- scripts/gen_dictionary_from_file.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7dd398339..e8bcf9a5e 100644 --- a/Makefile +++ b/Makefile @@ -544,8 +544,8 @@ extinc: $(METADEPEND) $(METADEPEND): $(APIXML) $(GENSCRIPT) $(QUIET)$(MKDIR) $(METAPATH) $(QUIET)$(PYTHON) $(GENSCRIPT) $(GENSCRIPTOPTS) -o $(METAPATH) extinc - $(QUIET)$(PYTHON) $(CFEATSCRIPT) -file $(CFEATURES) -o $(METAPATH)/c-feature-dictionary.asciidoc - $(QUIET)$(PYTHON) $(CFUNCSCRIPT) -file $(CFUNCTIONS) -o $(METAPATH)/c-function-dictionary.asciidoc + $(QUIET)$(PYTHON) $(CFEATSCRIPT) -i $(CFEATURES) -o $(METAPATH)/c-feature-dictionary.asciidoc + $(QUIET)$(PYTHON) $(CFUNCSCRIPT) -i $(CFUNCTIONS) -o $(METAPATH)/c-function-dictionary.asciidoc # This generates a single file containing asciidoc attributes for each # extension in the spec being built. diff --git a/scripts/gen_dictionary_from_file.py b/scripts/gen_dictionary_from_file.py index dcfe5cc49..f2f6a72da 100644 --- a/scripts/gen_dictionary_from_file.py +++ b/scripts/gen_dictionary_from_file.py @@ -11,7 +11,7 @@ if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument('-file', action='store', + parser.add_argument('-i', action='store', default='', help='Input file with dictionary source to generate, one per line, stdin is used if no file is provided.') parser.add_argument('-o', action='store', default='', @@ -20,9 +20,9 @@ args = parser.parse_args() entries = [] - if len(args.file) > 0: - print('Generating dictionary from source file: ' + args.file) - with open(args.file) as f: + if args.i: + print('Generating dictionary from source file: ' + args.i) + with open(args.i) as f: entries = f.readlines() else: print('Generating dictionary from stdin.')