Coder Social home page Coder Social logo

jbock's People

Contributors

gitter-badger avatar h908714124 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jbock's Issues

Add description attribute

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.

Supplier<E> is compile error

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

Dynamic and/or hidden parameters?

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.

Changes in 3.4

Rename annotations to make the API more appealing:

  • CommandLineArguments -> CLI Command
  • Parameter -> Option
  • PositionalParameter -> Param

Handle large commands

Creating the command instance via constructor doesn't work if there are more than 255 options.

Get rid of (mandatory) attributes

Attributes can always be inferred:

  1. collector absent, mapper returns optional type -> optional
  2. collector absent, mapper returns list -> repeatable
  3. collector absent, mapper returns anything else but boolean -> not optional, not repeatable (~required)
  4. collector present -> repeatable, not optional; explanation:
    1. collector doesn't return optional type -> repeatable, not optional
    2. collector returns optional -> repeatable (otherwise collector won't be used), not optional (otherwise collector won't be used)

Error parsing empty string

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

uncaught validation error in 4.1.000

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);
        }
    }
}

Allow free type variable in collector

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>

@SuperCommand example in doc/wiki?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.