How to use getopt/optarg in Python?
This is an example of how I do it, I usually use the same basic template:
import sys
import getopt
try:
opts, args = getopt.getopt(sys.argv[1:], 'm:p:h', ['miner=', 'params=', 'help'])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt, arg in opts:
if opt in ('-h', '--help'):
usage()
sys.exit(2)
elif opt in ('-m', '--miner'):
miner_name = arg
elif opt in ('-p', '--params'):
params = arg
else:
usage()
sys.exit(2)
I don't think there is any 9 parameter limit.