forked from airlift/airline
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
enhancementProposed Enhancement/FeatureProposed Enhancement/Featureuser-experienceImproves user experienceImproves user experience
Milestone
Description
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 argument
e.g.
@Command(name = "pos-args")
public class PositionalArgumentExample {
@PositionalArgument(title = "Source", description = "The source file", position = { 0 })
private String source;
@PositionalArgument(title = "Target", description = "The target file", position = { 1 })
private String target;
@Arguments(title = "ExtraArg", description = "Extra arguments")
private List<String> extraArgs = new ArrayList();
}
Which would be used as follows:
> pos-args source.txt target.txt foo bar
Where source.txt would be set to the source field, target.txt set to the target field and the additional arguments passed to the extraArgs field
Metadata
Metadata
Assignees
Labels
enhancementProposed Enhancement/FeatureProposed Enhancement/Featureuser-experienceImproves user experienceImproves user experience