Class ArgUtils


  • public class ArgUtils
    extends Object

    Simple arg parsing utility.

    Author:
    Fugerit
    • Field Detail

      • 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 arguments
        checkParamFile - 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 arguments
        checkParamFile - 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