Class DefaultRuntimeConfigurationParser

java.lang.Object
org.savantbuild.runtime.DefaultRuntimeConfigurationParser
All Implemented Interfaces:
RuntimeConfigurationParser

public class DefaultRuntimeConfigurationParser extends Object implements RuntimeConfigurationParser
Default implementation that uses a simple brute force approach for now.
  • Constructor Details

    • DefaultRuntimeConfigurationParser

      public DefaultRuntimeConfigurationParser()
  • Method Details

    • parse

      public RuntimeConfiguration parse(String... arguments)

      Parses the command-line arguments. There are currently 4 fixed arguments:

         --noColor = Disables the colorized output of Savant
         --debug = Enables debug output
         --version = Displays the version
         --help = Displays the help message
         --listTargets = Lists the build targets
       

      If any other argument starts with -- then it is considered a switch. Switches can optionally have values using the equals sign like this:

         --switch=value
       

      All other arguments are considered targets to execute.

      This parser does care about ordering of the arguments at all.

      Specified by:
      parse in interface RuntimeConfigurationParser
      Parameters:
      arguments - The CLI arguments.
      Returns:
      The RuntimeConfiguration and never null.