private long parseOffset() {
        if (options.has(offsetOpt)) {
            switch (options.valueOf(offsetOpt).toLowerCase(Locale.ROOT)) {
                case "earliest":
                    return ListOffsetsRequest.EARLIEST_TIMESTAMP;
                case "latest":
                    return ListOffsetsRequest.LATEST_TIMESTAMP;
                default:
                    String offsetString = options.valueOf(offsetOpt);
                    try {
                        long offset = Long.parseLong(offsetString);
                        if (offset < 0) {
                            invalidOffset(offsetString);
                        }
                        return offset;
                    } catch (NumberFormatException nfe) {
                        invalidOffset(offsetString);
                    }
            }
        } else if (fromBeginning()) {
            return ListOffsetsRequest.EARLIEST_TIMESTAMP;
        }
        return ListOffsetsRequest.LATEST_TIMESTAMP;
    }
Used to retrieve the correct value for the consumer parameter 'auto.offset.reset'.
Order of priority is:
  1. Explicitly set parameter via --consumer.property command line parameter
  2. Explicit --from-beginning given -> 'earliest'
  3. Default value of 'latest'
In case both --from-beginning and an explicit value are specified an error is thrown if these
are conflicting.
tools/src/main/java/org/apache/kafka/tools/consumer/ConsoleConsumerOptions.java