start: v5
This commit is contained in:
25
v5/tPythonC++/translate
Executable file
25
v5/tPythonC++/translate
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
from process import *
|
||||
|
||||
DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: /path/to/translate [OPTIONS] PYTHON_FILE")
|
||||
sys.exit(1)
|
||||
|
||||
FILE_IN = sys.argv[-1]
|
||||
|
||||
# Parse options
|
||||
# TODO Use options
|
||||
OPT_HEADER = "--header" in sys.argv
|
||||
OPT_INCLUDES = None
|
||||
OPT_PREFIX_INCLUDES = "--includes="
|
||||
for arg in sys.argv:
|
||||
if arg.startswith(OPT_PREFIX_INCLUDES):
|
||||
OPT_INCLUDES = arg[len(OPT_PREFIX_INCLUDES):]
|
||||
|
||||
# Translate file.
|
||||
out = process(FILE_IN)#, OPT_HEADER, OPT_INCLUDES)
|
||||
print(out)
|
||||
Reference in New Issue
Block a user