You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by "Markus Weimer (JIRA)" <ji...@apache.org> on 2014/11/05 19:20:33 UTC

[jira] [Created] (REEF-34) Add utility function in Tang to parse command lines

Markus Weimer created REEF-34:
---------------------------------

             Summary: Add utility function in Tang to parse command lines
                 Key: REEF-34
                 URL: https://issues.apache.org/jira/browse/REEF-34
             Project: REEF
          Issue Type: Bug
          Components: Tang
            Reporter: Markus Weimer
            Assignee: Markus Weimer
            Priority: Minor


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:

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

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

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

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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)