Class CLIProcessor

java.lang.Object
gov.nist.secauto.metaschema.cli.processor.CLIProcessor

public class CLIProcessor extends Object
  • Field Details

    • HELP_OPTION

      @NonNull public static final org.apache.commons.cli.Option HELP_OPTION
    • NO_COLOR_OPTION

      @NonNull public static final org.apache.commons.cli.Option NO_COLOR_OPTION
    • QUIET_OPTION

      @NonNull public static final org.apache.commons.cli.Option QUIET_OPTION
    • SHOW_STACK_TRACE_OPTION

      @NonNull public static final org.apache.commons.cli.Option SHOW_STACK_TRACE_OPTION
    • VERSION_OPTION

      @NonNull public static final org.apache.commons.cli.Option VERSION_OPTION
    • OPTIONS

      @NonNull public static final List<org.apache.commons.cli.Option> OPTIONS
    • COMMAND_VERSION

      public static final String COMMAND_VERSION
      See Also:
  • Constructor Details

  • Method Details

    • main

      public static void main(String... args)
    • getExec

      @NonNull public String getExec()
      Gets the command used to execute for use in help text.
      Returns:
      the command name
    • getVersionInfos

      @NonNull public Map<String,IVersionInfo> getVersionInfos()
      Retrieve the version information for this application.
      Returns:
      the versionInfo
    • addCommandHandler

      public void addCommandHandler(@NonNull ICommand handler)
    • process

      @NonNull public ExitStatus process(String... args)
      Process a set of CLIProcessor arguments.

      process().getExitCode().getStatusCode()

      Parameters:
      args - the arguments to process
      Returns:
      the exit status
    • getTopLevelCommands

      protected final List<ICommand> getTopLevelCommands()
    • handleQuiet

      public static void handleQuiet()
    • showVersion

      protected void showVersion()