swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

CLI should be able to output its own version

Open ePaul opened this issue 10 years ago • 5 comments

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 avatar May 31 '16 10:05 ePaul

@ePaul agree that it would be useful to show the version.

wing328 avatar May 31 '16 11:05 wing328

@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

jimschubert avatar Jun 18 '16 15:06 jimschubert

If anyone from the community wants to work on this, please reply to let us know (to avoid duplicated effort)

wing328 avatar Jun 18 '16 15:06 wing328

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.

MiguelGL avatar Sep 28 '16 21:09 MiguelGL

This is already implemented in #3899, which is merged. Closing this issue now.

ePaul avatar Mar 02 '17 21:03 ePaul