Skip to content

Commit

Permalink
switch command line argument to specify input file to -i
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbaug committed Sep 10, 2024
1 parent 8a97575 commit 23d7dfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions scripts/gen_dictionary_from_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='',
Expand All @@ -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.')
Expand Down

0 comments on commit 23d7dfb

Please sign in to comment.