@Override
  protected CommandLineParser newParser() {
    // Commons-CLI lacks the capability to handle combinations of options, so we do it ourselves
    // Validate in parse() to get helpful error messages instead of exploding in processOptions()
    return new DefaultParser() {
      @Override
      public CommandLine parse(org.apache.hbase.thirdparty.org.apache.commons.cli.Options opts,
        String[] args, Properties props, boolean stop) throws ParseException {
        CommandLine cl = super.parse(opts, args, props, stop);
        if (!cmd.hasOption(Options.LIST_SNAPSHOTS) && !cmd.hasOption(Options.SNAPSHOT)) {
          throw new ParseException("Missing required snapshot option!");
        }
        return cl;
      }
    };
  }
Collect the hfiles and logs statistics of the snapshot and dump the file list if requested and
the collected information.
hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java