@SuppressWarnings("AccessStaticViaInstance")
    private static Options createOptions() {
        Options options = new Options();

        options.addOption(Option.builder("h")
                .hasArg(false)
                .desc("Show this syntax page.")
                .longOpt(HELP_OPTION)
                .build());

        options.addOption(Option.builder("i")
                .hasArg(false)
                .desc("Show only identifiers of retrieved documents.")
                .longOpt(PRINTIDS_OPTION)
                .build());

        options.addOption(Option.builder("f")
                .hasArg(true)
                .desc("Retrieve the specified fields only (see https://docs.vespa.ai/en/documents.html#fieldsets) (default '" + DocumentOnly.NAME + "')")
                .longOpt(FIELDSET_OPTION)
                .argName("fieldset").build());

        options.addOption(Option.builder("u")
                .hasArg(true)
                .desc("Send request to the given content cluster.")
                .longOpt(CLUSTER_OPTION)
                .argName("cluster").build());

        options.addOption(Option.builder("r")
                .hasArg(true)
                .desc("Send request to the given messagebus route.")
                .longOpt(ROUTE_OPTION)
                .argName("route").build());

        options.addOption(Option.builder("c")
                .hasArg(true)
                .desc("Use the specified config id for messagebus configuration.")
                .longOpt(CONFIGID_OPTION)
                .argName("configid").build());

        options.addOption(Option.builder("s")
                .hasArg(false)
                .desc("Show binary size of document.")
                .longOpt(SHOWDOCSIZE_OPTION).build());

        options.addOption(Option.builder("t")
                .hasArg(true)
                .desc("Set timeout for the request in seconds (default 0).")
                .longOpt(TIMEOUT_OPTION)
                .argName("timeout")
                .type(Number.class).build());

        options.addOption(Option.builder("n")
                .hasArg(false)
                .desc("Do not retry operation on transient errors, as is default.")
                .longOpt(NORETRY_OPTION).build());

        options.addOption(Option.builder("a")
                .hasArg(true)
                .desc("Trace level to use (default 0).")
                .longOpt(TRACE_OPTION)
                .argName("trace")
                .type(Number.class).build());

        options.addOption(Option.builder("p")
                .hasArg(true)
                .desc("Priority (default 6).")
                .longOpt(PRIORITY_OPTION)
                .argName("priority").build());

        options.addOption(Option.builder("j")
                .hasArg(false)
                .desc("JSON output (default format)")
                .longOpt(JSONOUTPUT_OPTION).build());

        options.addOption(Option.builder("x")
                .hasArg(false)
                .desc("XML output")
                .longOpt(XMLOUTPUT_OPTION).build());

        // TODO Vespa 9: replace with --longtensors ?
        options.addOption(Option.builder()
                .longOpt(SHORTTENSORS_OPTION)
                .desc("Output JSON tensors in short form. Will be the default on Vespa 9")
                .hasArg(false)
                .build());

        return options;
    }
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