Package com.openstego.desktop.util.cmd
Class CmdLineParser
- java.lang.Object
-
- com.openstego.desktop.util.cmd.CmdLineParser
-
public class CmdLineParser extends java.lang.Object
Utility to parse the command line parameters
-
-
Constructor Summary
Constructors Constructor Description CmdLineParser(CmdLineOptions stdOptions, java.lang.String[] args)
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getNonStdOptions()
Method to get the list of non-standard optionsint
getNumOfOptions()
Method to get the total number of options (standard plus non-standard) provided in the command-linejava.lang.String
getOptionName(int index)
Method to get the name of the option by indexjava.lang.String
getOptionValue(java.lang.String name)
Method to get the value of the given option (by name)CmdLineOptions
getParsedOptions()
Get method for parsedOptionsjava.util.List<CmdLineOption>
getParsedOptionsAsList()
Method to get the list of standard optionsboolean
isValid()
Method to check whether the command-line options are valid or not.
-
-
-
Constructor Detail
-
CmdLineParser
public CmdLineParser(CmdLineOptions stdOptions, java.lang.String[] args)
Default constructor- Parameters:
stdOptions
- List of standard optionsargs
- Command line arguments
-
-
Method Detail
-
isValid
public boolean isValid()
Method to check whether the command-line options are valid or not. This should be called immediately after the constructor is called.- Returns:
- Flag to indicate whether options are valid or not
-
getOptionValue
public java.lang.String getOptionValue(java.lang.String name)
Method to get the value of the given option (by name)- Parameters:
name
- Name of the option- Returns:
- Value of the command-line option
-
getOptionName
public java.lang.String getOptionName(int index)
Method to get the name of the option by index- Parameters:
index
- Index of the option- Returns:
- Name of the command-line option
-
getParsedOptionsAsList
public java.util.List<CmdLineOption> getParsedOptionsAsList()
Method to get the list of standard options- Returns:
- List of standard options
-
getNonStdOptions
public java.util.List<java.lang.String> getNonStdOptions()
Method to get the list of non-standard options- Returns:
- List of non-standard options
-
getParsedOptions
public CmdLineOptions getParsedOptions()
Get method for parsedOptions- Returns:
- parsedOptions
-
getNumOfOptions
public int getNumOfOptions()
Method to get the total number of options (standard plus non-standard) provided in the command-line- Returns:
- Total number of options provided in the command-line
-
-