code: protected void validateArgumentList(String[] args) {
          checkRequiredArguments(args);
  
          // Skip the first argument as it is the task name
          // Arguments and values come in pairs (expect -password).
          // Anything outside of that pattern is invalid.
          // Loop through, jumping in pairs except when we encounter
          // -password -- that may be an interactive prompt which won't
          // define a value.
          for (int i = 1; i < args.length; i++) {
              String argPair = args[i];
              String arg = null;
              String value = null;
              if (argPair.contains("=")) {
                  arg = argPair.split("=")[0];
                  value = getValue(argPair);
              } else {
                  arg = argPair;
              }
  
              if (!isKnownArgument(arg)) {
                  throw new IllegalArgumentException(getMessage("invalidArg", arg));
              } else {
                  if (value == null) {
                      throw new IllegalArgumentException(getMessage("missingValue", arg));
                  }
              }
          }
      }
docs: Validates that there are no unknown arguments or values specified
  to the task.
  
  @param args The script arguments
  @throws IllegalArgumentException if an  argument is defined is unknown