Skip to content

Commit 709b1a9

Browse files
authored
Merge pull request opencontainers#43 from xiekeyang/shorthand
add version shorthand to commands
2 parents 5702049 + fca9362 commit 709b1a9

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

cmd/oci-create-runtime-bundle/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ func newBundleCmd(stdout, stderr *log.Logger) *cobra.Command {
8787
It is strongly recommended to keep the default value.`,
8888
)
8989

90-
cmd.Flags().BoolVar(
91-
&v.version, "version", false,
90+
cmd.Flags().BoolVarP(
91+
&v.version, "version", "v", false,
9292
`Print version information and exit`,
9393
)
9494
return cmd

cmd/oci-image-validate/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ func newValidateCmd(stdout, stderr *log.Logger) *cobra.Command {
8484
`A set of refs pointing to the manifests to be validated. Each reference must be present in the "refs" subdirectory of the image. Only applicable if type is image or imageLayout.`,
8585
)
8686

87-
cmd.Flags().BoolVar(
88-
&v.version, "version", false,
87+
cmd.Flags().BoolVarP(
88+
&v.version, "version", "v", false,
8989
`Print version information and exit`,
9090
)
9191

cmd/oci-unpack/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ func newUnpackCmd(stdout, stderr *log.Logger) *cobra.Command {
7979
&v.ref, "ref", "v1.0",
8080
`The ref pointing to the manifest to be unpacked. This must be present in the "refs" subdirectory of the image.`,
8181
)
82-
cmd.Flags().BoolVar(
83-
&v.version, "version", false,
82+
83+
cmd.Flags().BoolVarP(
84+
&v.version, "version", "v", false,
8485
`Print version information and exit`,
8586
)
8687
return cmd

0 commit comments

Comments
 (0)