Closed stefan11 closed 3 years ago
You can already choose the indextype you want to run the script on
python3 fixindex.py s
for subject index
python3 fixindex.py l
for language index
python3 fixindex.py a
for name index
python3 fixindex.py
also for name index
python3 fixindex.py w
for the file main.wdx, whatever that file may contain.
I want to use it on grammatical-theory.adx, main.adx, check-gt.adx. Currently I have to adapt the script:
# indextypes = "a"
# try:
# indextypes = sys.argv[1]
# except IndexError:
# pass
# for indextype in indextypes:
# processfile("main.%sdx" % indextype)
filename = 'main.adx'
try:
filename = sys.argv[1]
except IndexError:
print("no filename given. Default is main.adx")
processfile(filename)
It would be good to be able to run the script on other files than main.adx, so passing the filename as an argument or an option would be great.