I’m using Jython 2.1 for wsadmin scripting and want to find a better way of parsing command line options. I’m currently doing this:
-> deploy.py foo bar baz
and then in the script:
foo = sys.arg[0]
bar = sys.arg[1]
baz = sys.arg[2]
but would like to do this:
-> deploy.py -f foo -b bar -z baz
optparse was added to python in 2.3. What other options do I have in Jython 2.1?
How about something like this:
Disclaimer: Not tested in any way.