Commit 7bbde5f9 authored by Juergen Nickelsen's avatar Juergen Nickelsen

adapt to posix_getops

parent 2746bb85
......@@ -11,7 +11,7 @@ import sys
# site modules
sys.path.append('/opt/w21/lib/python3')
import get_opts
import posix_getopts
wherefrom = os.path.dirname(sys.argv[0])
sys.path.append(wherefrom)
......@@ -28,19 +28,15 @@ usage = """\
usage: pyle [-t] [-l loadfile] [-d debugfflags] [-L loadpath] [program] ...
"""
odesc = {
"t": [0, bool, "traceback"],
"l": [[], str, "loadfiles"],
"d": [[], str, "debugflags"],
"r": [100000, int, "recursion_limit"],
"s": [0, bool, "evalstack"],
"L": [default_loadpath, str, "loadpath"],
"e": [0, bool, "exit_on_error"],
}
try:
ovc, argv = get_opts.parse(odesc, sys.argv)
except get_opts.OptionError as e:
sys.exit(program + ": " + str(e) + "\n" + usage)
ovc, argv = posix_getopts.parse({
"t": [0, bool, "traceback", "print python tracebacks on error"],
"l": [[], str, "loadfiles", "load file(s)"],
"d": [[], str, "debugflags", "set debug flag(s)"],
"r": [100000, int, "recursion_limit", "set recursion limit"],
"s": [0, bool, "evalstack", "print eval stack or error"],
"L": [default_loadpath, str, "loadpath", "set the load path"],
"e": [0, bool, "exit_on_error", "exit on error"],
})
# dbg.p(dbg.main, sys.argv[0], "starting up")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment