-
Notifications
You must be signed in to change notification settings - Fork 20
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
Support positional arguments #91
Comments
Concrete tasks:
|
- Adds `@PositionalArgument` annotation - Adds new `ArgumentMetadata` class - MetadataLoader collects positional arguments
- Capture positional arguments during parsing - Add PositionalArgumentMetadata variant to ArgumentsRestriction methods - Modify ParserUtils to also provide injection of positional arguments - Clean up some deprecation warnings
- Select correct target Java type to convert to based on the current positional argument being parsed - Use correct title for both positional and non-positional arguments
All built-in restrictions should now support positional arguments
- CLI command help includes positional arguments in its output - Additional tests for using @PositionalArgument without @arguments present and associated bug fix
Starts working on CLI command group usage generator
Moved out to 2.8 |
- Adds `@PositionalArgument` annotation - Adds new `ArgumentMetadata` class - MetadataLoader collects positional arguments
- Capture positional arguments during parsing - Add PositionalArgumentMetadata variant to ArgumentsRestriction methods - Modify ParserUtils to also provide injection of positional arguments - Clean up some deprecation warnings
- Select correct target Java type to convert to based on the current positional argument being parsed - Use correct title for both positional and non-positional arguments
All built-in restrictions should now support positional arguments
- CLI command help includes positional arguments in its output - Additional tests for using @PositionalArgument without @arguments present and associated bug fix
Starts working on CLI command group usage generator
Moved to 3.x branch |
Hey @rvesse , I'm working on integrating Airline into Quarkus GitHub App (it's a framework used to develop GitHub Apps) to parse commands included in GitHub comments (basically to have a comment-based commands bot). This Anything I can do to help make it happen? AFAICS, you have made a lot of progress on this already. And btw, a good opportunity to thank you for your work on this: it was exactly what I was looking for and it's flexible enough to meet my requirement even if it's not the typical use case of this library. |
Hey @gsmet, So the core implementation was done a long time ago as the commits show, this was being done in aid of $dayjob usage of this library but priorities changed and we never ended up adopting this feature so it didn't get finished up. I would really like to finish it and get a 3.x release out at some point. The main areas of this feature that need finishing are:
There are Alpha builds available via https://central.sonatype.org/publish/publish-guide/#accessing-repositories if you want to experiment with it in your project. Note Airline counts as a legacy project so you'll need to use the older |
Currently
@Arguments
is a general annotation that can only be applied to a single field and collects all non-option values into that field. There are various use cases where it might be nicer to support true positional arguments i.e. a new@PositionalArgument
annotation such that arguments could be captured on separate fields and provide more detailed help specific to each argumente.g.
Which would be used as follows:
Where
source.txt
would be set to thesource
field,target.txt
set to thetarget
field and the additional arguments passed to theextraArgs
fieldThe text was updated successfully, but these errors were encountered: