Package org.fugerit.java.core.cli
Class ArgUtils
- java.lang.Object
-
- org.fugerit.java.core.cli.ArgUtils
-
public class ArgUtils extends Object
Simple arg parsing utility.
- Author:
- Fugerit
-
-
Field Summary
Fields Modifier and Type Field Description static String
ARG_DEFAULT_VALUE
Default vaule for arguments withoug valuestatic String
ARG_PARAM_FILE
Param file argument If the param-file argument is set, its red as a property file and each entry is treated as an argument value.static String
ARG_PREFIX
Prefix for all arguments
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Properties
getArgs(String[] args)
Parse an argument list as a property object.static Properties
getArgs(String[] args, boolean checkParamFile)
Parse an argument list as a property object.static Properties
getArgs(String[] args, boolean checkParamFile, boolean priorityToParamFile)
Parse an argument list as a property object.static String
getArgString(String argName)
Create an argument string, ARG_PREFIX+argName.
-
-
-
Field Detail
-
ARG_PREFIX
public static final String ARG_PREFIX
Prefix for all arguments- See Also:
- Constant Field Values
-
ARG_DEFAULT_VALUE
public static final String ARG_DEFAULT_VALUE
Default vaule for arguments withoug value- See Also:
- Constant Field Values
-
ARG_PARAM_FILE
public static final String ARG_PARAM_FILE
Param file argument If the param-file argument is set, its red as a property file and each entry is treated as an argument value.- See Also:
- Constant Field Values
-
-
Method Detail
-
getArgString
public static String getArgString(String argName)
Create an argument string, ARG_PREFIX+argName.
- Parameters:
argName
- the name of the argument- Returns:
- the argument string
-
getArgs
public static Properties getArgs(String[] args, boolean checkParamFile)
Parse an argument list as a property object.
- Parameters:
args
- command line argumentscheckParamFile
- true if param-file should be checked if the argument is set.- Returns:
- the arguments parsed
-
getArgs
public static Properties getArgs(String[] args, boolean checkParamFile, boolean priorityToParamFile)
Parse an argument list as a property object.
- Parameters:
args
- command line argumentscheckParamFile
- true if param-file should be checked if the argument is set.priorityToParamFile
- true if param-file arguments should override command line arguments- Returns:
- the arguments parsed
-
getArgs
public static Properties getArgs(String[] args)
Parse an argument list as a property object.
param-file is checked by default at the end.
- Parameters:
args
- command line arguments- Returns:
- the arguments parsed
-
-