From aad33053bc134ea29484856c85413a64b01a2583 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 6 Oct 2016 16:19:02 -0700 Subject: [PATCH] cmd/oci-image-tool/main.go: Add description with supported versions This shows up in the --help output. I expect image-tools to support a range of image-spec versions, not just a single one. For example, once image-spec cuts 2.0, image-tools should still be able to process 1.x images for some reasonable deprecation period. image-spec is setting us up for that possibility by using the v1 package for the Go types that are likely to change. And SemVer means that if we can unpack a 1.3 image, we can also unpack 1.2, 1.1, and 1.0 images. So I think we want this to be printing: * OCI Image Format Specification: 1.0.0-rc5 now. Once 1.0 is cut we should show: * OCI Image Format Specification: 1.0.0 Once 1.1 is cut we should show our position in the 1.x series: * OCI Image Format Specification: 1.1.0 And then when 2.0 is cut we should show our positions in both the 1.x and 2.x series. If 2.0 happened after 1.1 (without a 1.2, etc.), that would be: * OCI Image Format Specification: 1.1.0, 2.0.0 I see less need to support multiple runtime-spec formats, since they're only used in 'oci-image-tool create ...'. But the approach I used for image-spec ports well to runtime-spec, so I've listed a version for it too. Signed-off-by: W. Trevor King --- cmd/oci-image-tool/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/oci-image-tool/main.go b/cmd/oci-image-tool/main.go index e91d59a..a3fdba5 100644 --- a/cmd/oci-image-tool/main.go +++ b/cmd/oci-image-tool/main.go @@ -20,6 +20,8 @@ import ( "github.com/Sirupsen/logrus" "github.com/opencontainers/image-tools/version" + image_spec "github.com/opencontainers/image-spec/specs-go" + runtime_spec "github.com/opencontainers/runtime-spec/specs-go" "github.com/urfave/cli" ) @@ -35,6 +37,7 @@ func main() { } else { app.Version = version.Version } + app.Description = fmt.Sprintf("Tools for working with OCI images. Currently supported specifications are:\n\n * OCI Image Format Specification: %s\n * OCI Runtime Specification: %s", image_spec.Version, runtime_spec.Version) app.Usage = "OCI (Open Container Initiative) image tools" app.Flags = []cli.Flag{ cli.BoolFlag{