parameters: ()
return_statement: return options
docstring: Parse command line options.
docstring_summary: Parse command line options.
docstring_tokens: Parse command line options .
function: def ParseOption():
    """Parse command line options."""
    parser = optparse.OptionParser()
    parser.add_option('--mapname', dest='mapname')
    parser.add_option('--key_type', dest='key_type')
    parser.add_option('--result_type', dest='result_type')
    parser.add_option('--filename', dest='filename')
    (options, unused_args) = parser.parse_args()
  
    if not options.mapname:
      print('Error: the output map name should be specified.')
      sys.exit(2)
    if not options.key_type:
      options.key_type = 'unsigned short'
    if not options.result_type:
      print('Error: the result type of the output map should be speicified.')
    if not options.filename:
      print('Error: the file name is not specified.')
    return options
function_tokens: def ParseOption ( ) : parser = optparse . OptionParser ( ) parser . add_option ( '--mapname' , dest = 'mapname' ) parser . add_option ( '--key_type' , dest = 'key_type' ) parser . add_option ( '--result_type' , dest = 'result_type' ) parser . add_option ( '--filename' , dest = 'filename' ) ( options , unused_args ) = parser . parse_args ( ) if not options . mapname : print ( 'Error: the output map name should be specified.' ) sys . exit ( 2 ) if not options . key_type : options . key_type = 'unsigned short' if not options . result_type : print ( 'Error: the result type of the output map should be speicified.' ) if not options . filename : print ( 'Error: the file name is not specified.' ) return options