unless you really need to customize option processing in some wayan optionparser will usually be created with no arguments for examplep optparse optionparser(an instancepof optionparser supports the following methodsp add_option(name namen [**parms]adds new option to the arguments name name and so on are all of the various names for the option for exampleyou might include short and long option names such as '-fand '--filefollowing the option namesan optional set of keyword arguments is supplied that specifies how the option will be processed when parsed these keyword arguments are described in the following listkeyword argument description action action to perform when the option is parsed acceptable values are as follows'store'--option has an argument that is read and stored this is the default if no action is specified explicitly 'store_const'--the option takes no argumentsbut when the option is encountereda constant value specified with the const keyword argument is stored 'store_true'--like 'store_constbut stores boolean true when the option is parsed 'store_false'--like 'store_truebut stores false instead 'append'--option has an argument that is appended to list when parsed this is used if the same command-line option is used to specify multiple values 'count'--option takes no argumentsbut counter value is stored the counter value is increased by one each time the argument is encountered 'callback'--invokes callback function specified with the callback keyword argument when the option is encountered 'help'--prints help message when the option is parsed this is only needed if you want help to be displayed via different option than the standard - or --help option 'version'--prints the version number supplied to optionparser()if any only used if you want to display version information using an option other than the standard - or --version option specifies callback function to be invoked when the option is encountered this callback function is python callable object that is invoked as callback(optionopt_strvalueparser*args**kwargsthe option argument is an instance of optparse optionopt_str is the option string supplied on the command line that triggered the callbackvalue is the value of the option (if any)parser is the instance of optionparser that' runningargs are positional arguments supplied using the callback_args keyword argumentand kwargs are keyword arguments supplied using the callback_kwargs keyword argument callback lib fl ff