jbock-java / jbock Goto Github PK
View Code? Open in Web Editor NEWReflectionless command line parser
License: MIT License
Reflectionless command line parser
License: MIT License
All annotations should get an additional attribute "description", similar to jcommander and picocli. Javadoc reading will be a fallback where this attribute is not set.
Specifying a mapper class which has a type parameter E
and implements Supplier<E>
leads to an uncaught exception at compile time.
Fixed in 59e52bc
I have a use case where I'd like to add/remove an option based on the presence/absence of a module on the classpath. I'm assuming this is impossible to do this at compile-time, but alternatively, hiding an option from the usage printout should be possible at runtime.
One way I imagined this could be possible by calling StandardErrorHandler's printUsageDocumentation using a different CommandModel
with fewer elements, but cloning or modifying the command model is currently not possible afaik.
Rename annotations to make the API more appealing:
for example: Param.isList
should either take a VariableElement
or a TypeMirror
Creating the command instance via constructor doesn't work if there are more than 255 options.
Attributes can always be inferred:
In 2.8.4, and possibly some of the previous 10 or so revisions, the generated code for positional parameters can't handle the empty string, causing a stacktrace and no useful message at runtime.
Fixed in d74fb71
Tested in 4.1.000
, affects versions since 4.0.000
This examples cause an uncaught AssertionError during compilation
@Command
abstract class BadCommand {
@Parameters(converter = MyConverter.class)
abstract Integer something();
static class MyConverter implements Function<String, Integer> {
@Override
public Integer apply(String s) {
return Integer.parseInt(s);
}
}
}
If the type of the collector is
<E, F> Collector<E, ?, List<F>>
so F
can be inferred from the parameter but E
is still free.
This is currently not allowed, but should be.
The mapper can be any function that accepts strings, for example:
Function<String, String>
<V> Function<String, V>
<V> Function<V, V>
<V> Function<V, List<V>>
<V, T> Function<V, T>
Not really clear how @Command
and @SuperCommand
can/should be used in combination. Would it be possible to get an illustrated example (in the wiki or in the examples folder)? I'd say "git" is a good example of command to illustrate the expected behaviour.
in constructor, as an alternative to String
seems to cause dagger bug
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.