Uploaded image for project: 'REEF (Retired)'
  1. REEF (Retired)
  2. REEF-34

Add utility function in Tang to parse command lines

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • Tang
    • None

    Description

      The dominant usecase for the CommandLine class in Tang is to parse a command line argument array straight into a Configuration, given a set of named parameters. I suggest to add this as a static utility function with the following signature:

      public static Configuration parseToConfiguration(final String[] args, final Class<? extends Name<?>>... argClasses) throws ParseException;
      

      And while we are at it, we might just as well add:

      public static ConfigurationBuilder parseToConfigurationBuilder(final String[] args, final Class<? extends Name<?>>... argClasses) throws ParseException;
      

      Having these two methods should clean up our examples quite a bit.

      Attachments

        Issue Links

          Activity

            People

              juliaw Julia Wang
              markus.weimer Markus Weimer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: