private static DocumentProtocol.Priority parsePriority(String name) {
        try {
            return DocumentProtocol.Priority.valueOf(name);
        } catch (IllegalArgumentException e) {
        }
        try {
            int n = Integer.parseInt(name);
            for (DocumentProtocol.Priority priority : DocumentProtocol.Priority.values()) {
                if (priority.getValue() == n) {
                    return priority;
                }
            }
        } catch (NumberFormatException e) {
        }
        throw new IllegalArgumentException("Invalid priority: " + name);
    }
This class is responsible for parsing the command line arguments and print the help page.

@author bjorncs
vespaclient-java/src/main/java/com/yahoo/vespaget/CommandLineOptions.java