rvesse / airline

Java annotation-based framework for parsing Git like command line structures with deep extensibility
https://rvesse.github.io/airline/
Apache License 2.0
131 stars 20 forks source link

Use airline with Spring DI fails in parse #90

Open ssnyder opened 5 years ago

ssnyder commented 5 years ago

I have a very simple application that is using Spring for DI, and when parsing the commandline If I run the command it fails (parser.parse(args)) because I do not have a no-parameter constructor.

Other than getting the parsedOptions in the state object, and manually setting the variables manually is there a supported solution? Examples?

Thanks!

rvesse commented 5 years ago

You may have to do some customisation of the command factory similar to #77 which was Google Guice related but likely the same basic problem.

FYI your report as it stands is unactionable, I haven't used Spring DI in years and so with your generic description can't really help you any further. Please provide a Minimal Complete Verifiable Example if you would like further help.

ssnyder commented 5 years ago

I apologize for the weird report. I guess one thing that would have helped me was better documentation on how to use this with a Spring Application - or how to gather the list of parameters when a zero-argument constructor is not available. I expect that the Google Guice issue was similar from the description.

Unfortunately I do not currently have an example - but will attempt to get one together for you that is not going to violate any policies at my company :)