code: static void validateOption(String opt) throws IllegalArgumentException {
          // if opt is NULL do not check further
          if (opt == null) {
              return;
          }
          // handle the single character opt
          if (opt.length() == 1) {
              char ch = opt.charAt(0);
              if (!isValidOpt(ch)) {
                  throw new IllegalArgumentException("Illegal option name '" + ch + "'");
              }
          }
          // handle the multi character opt
          else {
              for (char ch : opt.toCharArray()) {
                  if (!isValidChar(ch)) {
                      throw new IllegalArgumentException("The option '" + opt + "' contains an illegal "
                              + "character : '" + ch + "'");
                  }
              }
          }
      }
docs: Validates whether {@code opt} is a permissible Option
  shortOpt.  The rules that specify if the {@code opt}
  is valid are:
  
  <ul>
  <li>a single character {@code opt} that is either
  ' '(special case), '?', '@' or a letter</li>
  <li>a multi character {@code opt} that only contains
  letters.</li>
  </ul>
  <p>
  In case {@code opt} is {@code null} no further validation is performed.
  </p>
  
  @param opt the option string to validate, may be null
  @throws IllegalArgumentException if the Option is not valid