airlift / airline

Java annotation-based framework for parsing Git like command line structures
Apache License 2.0
847 stars 138 forks source link

Support named positional arguments #6

Open electrum opened 11 years ago

electrum commented 11 years ago

There should be a way to specify that exactly two arguments are required:

git remote add <name> <url>

Currently, this must be done as List<String>, which requires the user code to do the min/max checking, and doesn't allowing mixed types, such as String and URI.

gaul commented 10 years ago

Any suggestions on how to implement this?

dain commented 10 years ago

we could add something like:

  @Arguments
  void setArguments(String name, URI uri) {
    ...
  }

We can extract the names using paranamer (or the Java 8 apis).