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

Allow using method arguments to specify the command line interface #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EugeneSusla
Copy link

See example in MethodCmdLineParser's javadoc

This would be especially useful for smaller scripts, as it reduces the amount of CLI code to be written.

One important benefit of this approach, is that the annotated method is callable from both cmdline and java in an idiomatic way:

  // Java
  MainClass.typesafeMain(new File("~/Downloads"), 42, "a string");
  # Shell
  main ~/Downloads -n 42 "a string"

See MethodCmdLineParserTest as well as javadoc on MethodCmdLineParser for usage examples

Most of the new functionality is covered by MethodCmdLineParserTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant