|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.di.pan.CommandLineOption
public class CommandLineOption
This class allows you to define command-line options.
Constructor Summary | |
---|---|
CommandLineOption(String option)
Creates a new normal command line option without a description |
|
CommandLineOption(String option,
String description,
NamedParams argument,
boolean hiddenOption)
Creates a new "array" command line option. |
|
CommandLineOption(String option,
String description,
StringBuffer argument)
Creates a new normal command line option |
|
CommandLineOption(String option,
String description,
StringBuffer argument,
boolean yesNo,
boolean hiddenOption)
Creates a new command line option. |
|
CommandLineOption(String option,
String description,
StringBuffer argument,
boolean yesNo,
boolean hiddenOption,
boolean extraParameter)
Creates a new command line option. |
Method Summary | |
---|---|
String |
extractAndSetArgument(String arg)
Gets the value of a commandline option |
StringBuffer |
getArgument()
|
String |
getDescription()
|
String |
getOption()
|
String |
getUsageDescription()
|
boolean |
isExtraParameter()
|
boolean |
isHiddenOption()
|
boolean |
isYesNo()
|
static boolean |
parseArguments(List<String> args,
CommandLineOption[] options,
LogChannelInterface log)
Parse and set the command line arguments using the defined options. |
static void |
printUsage(CommandLineOption[] options)
Print the usage of an application using the command line options. |
void |
setArgument(StringBuffer argument)
|
void |
setDescription(String description)
|
void |
setExtraParameter(boolean extraParameter)
|
void |
setHiddenOption(boolean hiddenOption)
|
void |
setOption(String option)
|
void |
setYesNo(boolean yesNo)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandLineOption(String option, String description, StringBuffer argument, boolean yesNo, boolean hiddenOption)
option
- The option stringdescription
- the description of the optionargument
- the StringBuffer that will contain the argument lateryesNo
- true if this is a Yes/No flaghiddenOption
- true if this option should not be shown in the usage list.public CommandLineOption(String option, String description, StringBuffer argument, boolean yesNo, boolean hiddenOption, boolean extraParameter)
option
- The option stringdescription
- the description of the optionargument
- the StringBuffer that will contain the argument lateryesNo
- true if this is a Yes/No flaghiddenOption
- true if this option should not be shown in the usage list.extraParameter
- true if this is an extra parameter after the regular options (filenames and so on)public CommandLineOption(String option, String description, NamedParams argument, boolean hiddenOption)
option
- The option stringdescription
- the description of the optionargument
- the StringBuffer that will contain the argument laterhiddenOption
- true if this option should not be shown in the usage list.public CommandLineOption(String option, String description, StringBuffer argument)
option
- The option stringdescription
- the description of the optionargument
- the StringBuffer that will contain the argument laterpublic CommandLineOption(String option)
option
- The option stringMethod Detail |
---|
public StringBuffer getArgument()
public void setArgument(StringBuffer argument)
argument
- The argument to set.public String getOption()
public void setOption(String option)
option
- The option to set.public boolean isYesNo()
public void setYesNo(boolean yesNo)
yesNo
- sets wether or not this is a Yes/No flagpublic String getDescription()
public void setDescription(String description)
description
- The description to set.public String getUsageDescription()
public String extractAndSetArgument(String arg)
arg
- The command line argument
public boolean isHiddenOption()
public void setHiddenOption(boolean hiddenOption)
hiddenOption
- The hiddenOption to set.public static boolean parseArguments(List<String> args, CommandLineOption[] options, LogChannelInterface log)
args
- The list of arguments to parseoptions
- The command line options to usepublic boolean isExtraParameter()
public void setExtraParameter(boolean extraParameter)
public static void printUsage(CommandLineOption[] options)
options
- the options to use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |