private void parse(String[] args) {
      ArgumentsParser parser = new ArgumentsParser(args);

      parseFlags(parser);

      fileNames = parser.getRemaining();
      if (inputList != null && !inputList.isEmpty()) {
        // append the file names to the end of the input list
        inputList.addAll(Arrays.asList(fileNames));
        fileNames = inputList.toArray(new String[inputList.size()]);
      }

      if (fileNames.length == 0) {
        if (!emptyOk) {
          context.err.println("no input files specified");
          throw new UsageException();
        }
      } else if (emptyOk) {
        context.out.println("ignoring input files");
      }

      if ((humanOutName == null) && (methodToDump != null)) {
        humanOutName = "-";
      }

      if (mainDexListFile != null && !multiDex) {
        context.err.println(
            MAIN_DEX_LIST_OPTION + " is only supported in combination with " + MULTI_DEX_OPTION);
        throw new UsageException();
      }

      if (minimalMainDex && (mainDexListFile == null || !multiDex)) {
        context.err.println(
            MINIMAL_MAIN_DEX_OPTION
                + " is only supported in combination with "
                + MULTI_DEX_OPTION
                + " and "
                + MAIN_DEX_LIST_OPTION);
        throw new UsageException();
      }

      if (multiDex && incremental) {
        context.err.println(INCREMENTAL_OPTION + " is not supported with " + MULTI_DEX_OPTION);
        throw new UsageException();
      }

      if (multiDex && outputIsDirectDex) {
        context.err.println(
            "Unsupported output \""
                + outName
                + "\". "
                + MULTI_DEX_OPTION
                + " supports only archive or directory output");
        throw new UsageException();
      }

      if (outputIsDirectory && !multiDex) {
        outName = new File(outName, DexFormat.DEX_IN_JAR_NAME).getPath();
      }

      makeOptionsObjects();
    }
Parses all command-line arguments and updates the state of the {@code Arguments} object
accordingly.

@param args {@code non-null;} the arguments
android/android_framework/dex-maker/src/main/java/com/android/dx/command/dexer/Main.java