Class SimpleCommandLineArguments

java.lang.Object
net.shibboleth.metadata.cli.SimpleCommandLineArguments

public class SimpleCommandLineArguments extends Object
Command line arguments for the SimpleCommandLine command line tool.
  • Field Details

    • otherArgs

      private List<String> otherArgs
      Command-line arguments which are not part of options.
    • inFile

      @Nullable private String inFile
      Provided input file name for the Spring configuration file.
    • pipelineName

      @Nullable private String pipelineName
      Provided name for the pipeline bean to execute.
    • verbose

      private boolean verbose
      Verbose logging has been requested.
    • quiet

      private boolean quiet
      Quiet logging has been requested.
    • logConfig

      @Nullable private String logConfig
      Name of a specific logging configuration, if one has been requested.
    • help

      private boolean help
      Help has been requested.
    • version

      private boolean version
      Version has been requested.
  • Constructor Details

    • SimpleCommandLineArguments

      public SimpleCommandLineArguments()
  • Method Details

    • parseCommandLineArguments

      public void parseCommandLineArguments(String[] args)
      Parse an array of command-line arguments as passed to the main program.
      Parameters:
      args - array of command-line arguments to parse.
    • getInputFile

      @Nullable public String getInputFile()
      Gets the parsed input file name from the command line.
      Returns:
      the input file name argument
    • getPipelineName

      @Nullable public String getPipelineName()
      Returns the name of the pipeline bean to execute from the command line.
      Returns:
      the pipeline bean name argument
    • doVerboseOutput

      public boolean doVerboseOutput()
      Indicates the presence of the --verbose option.
      Returns:
      true if the user requested verbose logging.
    • doQuietOutput

      public boolean doQuietOutput()
      Indicates the presence of the --quiet option.
      Returns:
      true if the user requested quiet logging.
    • getLoggingConfiguration

      @Nullable public String getLoggingConfiguration()
      Gets the name of the requested logging configuration file from the command line.
      Returns:
      the logging configuration file name, or null.
    • doHelp

      public boolean doHelp()
      Indicates the presence of the --help option.
      Returns:
      true if the user requested help.
    • doVersion

      public boolean doVersion()
      Indicates the presence of the --version option.
      Returns:
      true if the user requested the version be printed.
    • validateCommandLineArguments

      private void validateCommandLineArguments()
      Validate the provided command line arguments, for example issuing an error if they are inconsistent.
    • printHelp

      public void printHelp(PrintStream out)
      Print command line help instructions.
      Parameters:
      out - location where to print the output
    • errorAndExit

      private void errorAndExit(String error)
      Prints the error message to STDERR and then exits.
      Parameters:
      error - the error message