optparse.OptionParser.parse_args

OptionParser.parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string])[source]

Parse the command-line options found in ‘args’ (default: sys.argv[1:]). Any errors result in a call to ‘error()’, which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where ‘values’ is a Values instance (with all your option values) and ‘args’ is the list of arguments left over after parsing options.