parameters: (args)
return_statement: return options
docstring: Parses command line options.
  
    Returns:
      An options object as from optparse.OptionsParser.parse_args()
docstring_summary: Parses command line options.
docstring_tokens: Parses command line options .
function: def _ParseArgs(args):
    """Parses command line options.
  
    Returns:
      An options object as from optparse.OptionsParser.parse_args()
    """
    parser = optparse.OptionParser()
    build_utils.AddDepfileOption(parser)
  
    parser.add_option('--android-sdk-jar',
                      help='the path to android jar file.')
    parser.add_option('--aapt-path',
                      help='path to the Android aapt tool')
    parser.add_option('--non-constant-id', action='store_true')
  
    parser.add_option('--android-manifest', help='AndroidManifest.xml path')
    parser.add_option('--custom-package', help='Java package for R.java')
    parser.add_option(
        '--shared-resources',
        action='store_true',
        help='Make a resource package that can be loaded by a different'
        'application at runtime to access the package\'s resources.')
    parser.add_option(
        '--app-as-shared-lib',
        action='store_true',
        help='Make a resource package that can be loaded as shared library.')
  
    parser.add_option('--resource-dirs',
                      help='Directories containing resources of this target.')
    parser.add_option('--dependencies-res-zips',
                      help='Resources from dependents.')
  
    parser.add_option('--resource-zip-out',
                      help='Path for output zipped resources.')
  
    parser.add_option('--R-dir',
                      help='directory to hold generated R.java.')
    parser.add_option('--srcjar-out',
                      help='Path to srcjar to contain generated R.java.')
    parser.add_option('--r-text-out',
                      help='Path to store the R.txt file generated by appt.')
  
    parser.add_option('--proguard-file',
                      help='Path to proguard.txt generated file')
  
    parser.add_option(
        '--v14-skip',
        action="store_true",
        help='Do not generate nor verify v14 resources')
  
    parser.add_option(
        '--extra-res-packages',
        help='Additional package names to generate R.java files for')
    parser.add_option(
        '--extra-r-text-files',
        help='For each additional package, the R.txt file should contain a '
        'list of resources to be included in the R.java file in the format '
        'generated by aapt')
    parser.add_option(
        '--include-all-resources',
        action='store_true',
        help='Include every resource ID in every generated R.java file '
        '(ignoring R.txt).')
  
    parser.add_option(
        '--all-resources-zip-out',
        help='Path for output of all resources. This includes resources in '
        'dependencies.')
  
    parser.add_option('--stamp', help='File to touch on success')
  
    options, positional_args = parser.parse_args(args)
  
    if positional_args:
      parser.error('No positional arguments should be given.')
  
    # Check that required options have been provided.
    required_options = (
        'android_sdk_jar',
        'aapt_path',
        'android_manifest',
        'dependencies_res_zips',
        'resource_dirs',
        'resource_zip_out',
        )
    build_utils.CheckOptions(options, parser, required=required_options)
  
    if (options.R_dir is None) == (options.srcjar_out is None):
      raise Exception('Exactly one of --R-dir or --srcjar-out must be specified.')
  
    options.resource_dirs = build_utils.ParseGypList(options.resource_dirs)
    options.dependencies_res_zips = (
        build_utils.ParseGypList(options.dependencies_res_zips))
  
    # Don't use [] as default value since some script explicitly pass "".
    if options.extra_res_packages:
      options.extra_res_packages = (
          build_utils.ParseGypList(options.extra_res_packages))
    else:
      options.extra_res_packages = []
  
    if options.extra_r_text_files:
      options.extra_r_text_files = (
          build_utils.ParseGypList(options.extra_r_text_files))
    else:
      options.extra_r_text_files = []
  
    return options
function_tokens: def _ParseArgs ( args ) : parser = optparse . OptionParser ( ) build_utils . AddDepfileOption ( parser ) parser . add_option ( '--android-sdk-jar' , help = 'the path to android jar file.' ) parser . add_option ( '--aapt-path' , help = 'path to the Android aapt tool' ) parser . add_option ( '--non-constant-id' , action = 'store_true' ) parser . add_option ( '--android-manifest' , help = 'AndroidManifest.xml path' ) parser . add_option ( '--custom-package' , help = 'Java package for R.java' ) parser . add_option ( '--shared-resources' , action = 'store_true' , help = 'Make a resource package that can be loaded by a different' 'application at runtime to access the package\'s resources.' ) parser . add_option ( '--app-as-shared-lib' , action = 'store_true' , help = 'Make a resource package that can be loaded as shared library.' ) parser . add_option ( '--resource-dirs' , help = 'Directories containing resources of this target.' ) parser . add_option ( '--dependencies-res-zips' , help = 'Resources from dependents.' ) parser . add_option ( '--resource-zip-out' , help = 'Path for output zipped resources.' ) parser . add_option ( '--R-dir' , help = 'directory to hold generated R.java.' ) parser . add_option ( '--srcjar-out' , help = 'Path to srcjar to contain generated R.java.' ) parser . add_option ( '--r-text-out' , help = 'Path to store the R.txt file generated by appt.' ) parser . add_option ( '--proguard-file' , help = 'Path to proguard.txt generated file' ) parser . add_option ( '--v14-skip' , action = "store_true" , help = 'Do not generate nor verify v14 resources' ) parser . add_option ( '--extra-res-packages' , help = 'Additional package names to generate R.java files for' ) parser . add_option ( '--extra-r-text-files' , help = 'For each additional package, the R.txt file should contain a ' 'list of resources to be included in the R.java file in the format ' 'generated by aapt' ) parser . add_option ( '--include-all-resources' , action = 'store_true' , help = 'Include every resource ID in every generated R.java file ' '(ignoring R.txt).' ) parser . add_option ( '--all-resources-zip-out' , help = 'Path for output of all resources. This includes resources in ' 'dependencies.' ) parser . add_option ( '--stamp' , help = 'File to touch on success' ) options , positional_args = parser . parse_args ( args ) if positional_args : parser . error ( 'No positional arguments should be given.' ) # Check that required options have been provided. required_options = ( 'android_sdk_jar' , 'aapt_path' , 'android_manifest' , 'dependencies_res_zips' , 'resource_dirs' , 'resource_zip_out' , ) build_utils . CheckOptions ( options , parser , required = required_options ) if ( options . R_dir is None ) == ( options . srcjar_out is None ) : raise Exception ( 'Exactly one of --R-dir or --srcjar-out must be specified.' ) options . resource_dirs = build_utils . ParseGypList ( options . resource_dirs ) options . dependencies_res_zips = ( build_utils . ParseGypList ( options . dependencies_res_zips ) ) # Don't use [] as default value since some script explicitly pass "". if options . extra_res_packages : options . extra_res_packages = ( build_utils . ParseGypList ( options . extra_res_packages ) ) else : options . extra_res_packages = [ ] if options . extra_r_text_files : options . extra_r_text_files = ( build_utils . ParseGypList ( options . extra_r_text_files ) ) else : options . extra_r_text_files = [ ] return options