Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ergonomic API - convenience method to parse & run an app #26

Closed
remkop opened this issue Feb 11, 2017 · 2 comments
Closed

Ergonomic API - convenience method to parse & run an app #26

remkop opened this issue Feb 11, 2017 · 2 comments

Comments

@remkop
Copy link
Owner

remkop commented Feb 11, 2017

Add convenience methods that parse command line arguments, and execute a Callable on success, or print a usage message to the console and exit on failure.

@remkop remkop added this to the 0.4.0 user manual milestone Feb 11, 2017
@remkop remkop added the status: duplicate 👨🏻‍🤝‍👨🏻 A duplicate of another issue label Mar 20, 2017
@remkop
Copy link
Owner Author

remkop commented Mar 20, 2017

Duplicates #15.

@remkop
Copy link
Owner Author

remkop commented Mar 31, 2017

// CommandLine
public static void run(<T extends Runnable> app, String ... args) {
    try {
        new CommandLine(app).parse(args);
    } catch (Exception ex) {
        System.err.println(ex.getMessage());
        CommandLine.usage(app, System.err);
        return;
    }
    args.run();
}

@remkop remkop added the status: declined ❌ A suggestion or change that we don't feel we should currently apply label Mar 31, 2017
@remkop remkop changed the title Ergonomic API Ergonomic API - convenience method to parse & run an app Mar 31, 2017
remkop added a commit that referenced this issue Apr 2, 2017
@remkop remkop removed the status: declined ❌ A suggestion or change that we don't feel we should currently apply label Apr 2, 2017
@remkop remkop closed this as completed in 4ecb1d5 Apr 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant