INNER CODE UNIT · Python
parse_args
stp/stp · lib/AST/genkinds.py:45
def parse_args(argv):
"""Accept the option spellings the build (and Getopt::Long) uses."""
fname = "ASTKind.kinds"
timestamp = True
i = 0
while i < len(argv):
arg = argv[i]
if arg == "--file":
i += 1
if i >= len(argv):
sys.exit("Option file requires an argument\n")
fname = argv[i]
elif arg.startswith("--file="):
fname = arg[len("--file="):]
elif arg == "--timestamp":
timestamp = True
elif arg in ("--no-timestamp", "--notimestamp"):