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:26:34 UTC

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

    [ https://issues.apache.org/jira/browse/REEF-34?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14198785#comment-14198785 ] 

Markus Weimer commented on REEF-34:
-----------------------------------

I created a pull request for this: 

https://github.com/apache/incubator-reef/pull/11

[~juliaw] Can you take a look at it?

> 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)