code: private void checkOneArg(List<String> args, int index) throws OptionException {
          if ((index + 1) >= args.size() || args.get(index + 1).startsWith("-d")) {
              String text = messager.getText("main.requires_argument", args.get(index));
              throw new OptionException(CMDERR, this::usage, text);
          }
      }
docs: Check the one arg option.
  Error and exit if one argument is not provided.