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

Remaining todo items for supporting @Command-annotated methods #455

Closed
7 tasks done
remkop opened this issue Aug 27, 2018 · 0 comments
Closed
7 tasks done

Remaining todo items for supporting @Command-annotated methods #455

remkop opened this issue Aug 27, 2018 · 0 comments

Comments

@remkop
Copy link
Owner

remkop commented Aug 27, 2018

Some todos remain from PR #416:

  • (WON'T FIX) Remove the @Command(addMethodSubcommands) attribute and add method commands automatically as subcommands if (and only if) the class has a @Command annotation. I changed my mind on this; it is useful to be able to switch this off if needed.
  • (WON'T FIX) Make the CommandLine#addMethodSubcommands and getCommandMethods methods private to reduce the public API surface. I removed addMethodSubcommands (it wasn't used), but changed my mind on the getCommandMethods method and keeping it.
  • Don't mix in options/positional params from the containing class @Command into the method commands.
  • Command methods should be able to mix in the standard help options.
  • Bugfix: unannotated method parameters should be assigned a positional index matching their parameter index (but skipping @Option method parameters)
  • New feature: if compiled with the -parameters flag on Java 8 or higher, the method parameter name should be obtained with java.lang.reflect.Parameter#getName using reflection instead of the generic arg0, arg1, etc.
  • Add documentation for @Command methods. Ideally add a recommendation on when to use which annotation style. (Location could be after 15.1 Annotated Methods or perhaps a separate page.)
@remkop remkop added this to the 3.6 milestone Aug 27, 2018
remkop added a commit that referenced this issue Aug 28, 2018
* improved javadoc
* getCommandMethods now returns a List instead of a Map
* Bugfix: unannotated method parameters should be assigned a positional index matching their parameter index (but skipping @option method parameters)
* New feature: if compiled with the -parameters flag on Java 8 or higher, the method parameter name should be obtained with java.lang.reflect.Parameter#getName using reflection instead of the generic arg0, arg1, etc.
@remkop remkop closed this as completed in 1cb11aa Aug 28, 2018
remkop added a commit that referenced this issue Aug 29, 2018
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