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

Annotation with parameters #399

Open
queeg500 opened this issue Apr 22, 2024 · 0 comments
Open

Annotation with parameters #399

queeg500 opened this issue Apr 22, 2024 · 0 comments

Comments

@queeg500
Copy link

Hi,

I might be missing something in the documentation but I am struggling to keep annotated fields where the annotation has parameters. We are using a CLI library which annotations fields with command line arguments, descriptions etc. So my java code is something like

@picocli.CommandLine.Option(names = { "--argument", "-a" }, description = "An argument", required = true)  
private String testArgument;

and I want to keep 'testArgument' as this is shown to the user when they input an incorrect command, the classes do not always share an interface or extension point. With the following I can keep the field if I change the annotation to @java.lang.Deprecated

-keepclassmembers class * {
    @java.lang.Deprecated <fields>;
}

so I can't be too far away but following the Option with variations on '', '...', '??' to have it match the parameters don't appear to work. Is this something that is supported?

Thank you.

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

No branches or pull requests

1 participant