Skip to content
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

Override options in superclass #131

Open
chaosdefinition opened this issue Apr 10, 2016 · 0 comments · May be fixed by #183
Open

Override options in superclass #131

chaosdefinition opened this issue Apr 10, 2016 · 0 comments · May be fixed by #183

Comments

@chaosdefinition
Copy link

Is there a way for a subclass to override the options set in its superclasses?

e.g.

class Parent {
    @Option(name = "-n", aliases = "--number", usage = "set number")
    private int num;

    @Option(name = "-o", aliases = "--output", usage = "set output file")
    protected String output; // this option may be used in subclasses
}

class Child extends Parent {
    // want to override the option '-n' for another usage
    @Option(name = "-n", aliases = "--next", usage = "specify the next")
    private int next;
}

will cause an IllegalAnnotationError: Option name -n is used more than once.

Is this achievable?

@alapins alapins linked a pull request Jun 29, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant