CLI should be able to output its own version
Description
When getting a codegen CLI binary of unknown origin, it is currently not possible to know which version of codegen it is.
As an example, I yesterday downloaded the docker image mydock/swagger-codegen-prebuilt (from https://github.com/mydock/swagger-codegen-prebuilt, I guess) mentioned in #2991, and was unable to determine which version of swagger-codegen it is.
Swagger-codegen version
This applies to master from yesterday (2.2.0-SNAPSHOT) as well as all older versions I tested.
Suggest a Fix
There could be either an option (common are -V, --version) or a subcommand (version) which outputs the artifact version. Alternatively (or in addition) this could be included in the help command's output.
@ePaul agree that it would be useful to show the version.
@ePaul
I agree with your feature suggestion.
If you ever have a problem like this with an older version and you're trying to debug an issue, you can extract the manifest from he jar and look at the implementation-version:
$ unzip -p -j swagger-codegen*.jar "META-INF/MANIFEST.MF" | grep version
implementation-version: 2.2.0-SNAPSHOT
If anyone from the community wants to work on this, please reply to let us know (to avoid duplicated effort)
Just for the record, I just PR-ed wrt. this. I did not get to ask and coordinate as I thought it was a simple change.
This is already implemented in #3899, which is merged. Closing this issue now.