@Override
    protected void processOptions(CommandLine cmd) {
      requiredValue = cmd.getOptionValue(Options.REQUIRED.getLongOpt());
      if (cmd.hasOption(Options.OPTIONAL.getLongOpt())) {
        optionalValue = cmd.getOptionValue(Options.OPTIONAL.getLongOpt());
      }
      booleanValue = booleanValue || cmd.hasOption(Options.BOOLEAN.getLongOpt());
    }
Simple tool to test options parsing. 3 options: required, optional, and boolean 2 deprecated
options to test backward compatibility: -opt (old version of --optional) and -bool (old version
of --boolean).
hbase-common/src/test/java/org/apache/hadoop/hbase/util/AbstractHBaseToolTest.java