forked from OpenTTD/nml
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgen_editor
executable file
·29 lines (22 loc) · 868 Bytes
/
gen_editor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /usr/bin/env python3
import sys
from nml.editors import kate, notepadpp, visualstudiocode
def run():
if len(sys.argv) != 2 or sys.argv[1] not in ('kate', 'notepadpp', 'visualstudiocode', 'vs'):
print("gen_editor: Incorrect arguments found.")
print("Usage: gen_editor [ kate | notepadpp | visualstudiocode (or vs) ]")
sys.exit(1)
if sys.argv[1] == 'kate':
kate.run()
print("gen_editor: Created kate XML file")
elif sys.argv[1] == 'notepadpp':
notepadpp.run()
print("gen_editor: Created Notepad++ XML file")
elif sys.argv[1] == 'visualstudiocode' or sys.argv[1] == 'vs':
visualstudiocode.run()
print("gen_editor: Created Visual Studio Text Mark file")
else:
assert False, "Unknown editor name encountered."
sys.exit(0)
if __name__ == '__main__':
run()