protected void prepareOptions()

in impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/CommonsCliOptions.java [307:439]


        protected void prepareOptions(org.apache.commons.cli.Options options) {
            options.addOption(Option.builder(HELP)
                    .longOpt("help")
                    .desc("Display help information")
                    .build());
            options.addOption(Option.builder(USER_PROPERTY)
                    .numberOfArgs(2)
                    .valueSeparator('=')
                    .desc("Define a user property")
                    .build());
            options.addOption(Option.builder(SHOW_VERSION_AND_EXIT)
                    .longOpt("version")
                    .desc("Display version information")
                    .build());
            options.addOption(Option.builder(QUIET)
                    .longOpt("quiet")
                    .desc("Quiet output - only show errors")
                    .build());
            options.addOption(Option.builder(VERBOSE)
                    .longOpt("verbose")
                    .desc("Produce execution verbose output")
                    .build());
            options.addOption(Option.builder(SHOW_ERRORS)
                    .longOpt("errors")
                    .desc("Produce execution error messages")
                    .build());
            options.addOption(Option.builder(BATCH_MODE)
                    .longOpt("batch-mode")
                    .desc("Run in non-interactive mode. Alias for --non-interactive (kept for backwards compatability)")
                    .build());
            options.addOption(Option.builder()
                    .longOpt(NON_INTERACTIVE)
                    .desc("Run in non-interactive mode. Alias for --batch-mode")
                    .build());
            options.addOption(Option.builder()
                    .longOpt(FORCE_INTERACTIVE)
                    .desc(
                            "Run in interactive mode. Overrides, if applicable, the CI environment variable and --non-interactive/--batch-mode options")
                    .build());
            options.addOption(Option.builder(ALTERNATE_USER_SETTINGS)
                    .longOpt("settings")
                    .desc("Alternate path for the user settings file")
                    .hasArg()
                    .build());
            options.addOption(Option.builder(ALTERNATE_PROJECT_SETTINGS)
                    .longOpt("project-settings")
                    .desc("Alternate path for the project settings file")
                    .hasArg()
                    .build());
            options.addOption(Option.builder(ALTERNATE_INSTALLATION_SETTINGS)
                    .longOpt("install-settings")
                    .desc("Alternate path for the installation settings file")
                    .hasArg()
                    .build());
            options.addOption(Option.builder(ALTERNATE_USER_TOOLCHAINS)
                    .longOpt("toolchains")
                    .desc("Alternate path for the user toolchains file")
                    .hasArg()
                    .build());
            options.addOption(Option.builder(ALTERNATE_INSTALLATION_TOOLCHAINS)
                    .longOpt("install-toolchains")
                    .desc("Alternate path for the installation toolchains file")
                    .hasArg()
                    .build());
            options.addOption(Option.builder(FAIL_ON_SEVERITY)
                    .longOpt("fail-on-severity")
                    .desc("Configure which severity of logging should cause the build to fail")
                    .hasArg()
                    .build());
            options.addOption(Option.builder(LOG_FILE)
                    .longOpt("log-file")
                    .hasArg()
                    .desc("Log file where all build output will go (disables output color)")
                    .build());
            options.addOption(Option.builder()
                    .longOpt(RAW_STREAMS)
                    .desc("Do not decorate standard output and error streams")
                    .build());
            options.addOption(Option.builder(SHOW_VERSION)
                    .longOpt("show-version")
                    .desc("Display version information WITHOUT stopping build")
                    .build());
            options.addOption(Option.builder()
                    .longOpt(COLOR)
                    .hasArg()
                    .optionalArg(true)
                    .desc("Defines the color mode of the output. Supported are 'auto', 'always', 'never'.")
                    .build());
            options.addOption(Option.builder(OFFLINE)
                    .longOpt("offline")
                    .desc("Work offline")
                    .build());

            // Parameters handled by script
            options.addOption(Option.builder()
                    .longOpt(DEBUG)
                    .desc("Launch the JVM in debug mode (script option).")
                    .build());
            options.addOption(Option.builder()
                    .longOpt(ENC)
                    .desc("Launch the Maven Encryption tool (script option).")
                    .build());
            options.addOption(Option.builder()
                    .longOpt(SHELL)
                    .desc("Launch the Maven Shell tool (script option).")
                    .build());
            options.addOption(Option.builder()
                    .longOpt(YJP)
                    .desc("Launch the JVM with Yourkit profiler (script option).")
                    .build());

            // Deprecated
            options.addOption(Option.builder(ALTERNATE_GLOBAL_SETTINGS)
                    .longOpt("global-settings")
                    .desc("<deprecated> Alternate path for the global settings file.")
                    .hasArg()
                    .deprecated(DeprecatedAttributes.builder()
                            .setForRemoval(true)
                            .setSince("4.0.0")
                            .setDescription("Use -is,--install-settings instead.")
                            .get())
                    .build());
            options.addOption(Option.builder(ALTERNATE_GLOBAL_TOOLCHAINS)
                    .longOpt("global-toolchains")
                    .desc("<deprecated> Alternate path for the global toolchains file.")
                    .hasArg()
                    .deprecated(DeprecatedAttributes.builder()
                            .setForRemoval(true)
                            .setSince("4.0.0")
                            .setDescription("Use -it,--install-toolchains instead.")
                            .get())
                    .build());
        }