Skip to content

Commit 421458f

Browse files
authored
Merge pull request opencontainers#88 from Sn0rt/add-help
Help: with more help information (Issues opencontainers#13)
2 parents b809c3b + 9624729 commit 421458f

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ It is strongly recommended to keep the default value.`,
9191
&v.version, "version", "v", false,
9292
`Print version information and exit`,
9393
)
94+
95+
origHelp := cmd.HelpFunc()
96+
97+
cmd.SetHelpFunc(func(c *cobra.Command, args []string) {
98+
origHelp(c, args)
99+
stdout.Println("\nMore information:")
100+
stdout.Printf("\treferences\t%s\n", image.SpecURL)
101+
stdout.Printf("\tbug report\t%s\n", image.IssuesURL)
102+
})
103+
94104
return cmd
95105
}
96106

cmd/oci-image-validate/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ func newValidateCmd(stdout, stderr *log.Logger) *cobra.Command {
8989
`Print version information and exit`,
9090
)
9191

92+
origHelp := cmd.HelpFunc()
93+
94+
cmd.SetHelpFunc(func(c *cobra.Command, args []string) {
95+
origHelp(c, args)
96+
stdout.Println("\nMore information:")
97+
stdout.Printf("\treferences\t%s\n", image.SpecURL)
98+
stdout.Printf("\tbug report\t%s\n", image.IssuesURL)
99+
})
100+
92101
return cmd
93102
}
94103

cmd/oci-unpack/main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ func newUnpackCmd(stdout, stderr *log.Logger) *cobra.Command {
8484
&v.version, "version", "v", false,
8585
`Print version information and exit`,
8686
)
87+
88+
origHelp := cmd.HelpFunc()
89+
90+
cmd.SetHelpFunc(func(c *cobra.Command, args []string) {
91+
origHelp(c, args)
92+
stdout.Println("\nMore information:")
93+
stdout.Printf("\treferences\t%s\n", image.SpecURL)
94+
stdout.Printf("\tbug report\t%s\n", image.IssuesURL)
95+
})
96+
8797
return cmd
8898
}
8999

image/project.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2016 The Linux Foundation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package image
16+
17+
// SpecURL is the URL for the image-spec repository
18+
var SpecURL = "https://github.com/opencontainers/image-spec"
19+
20+
// IssuesURL is the URL for the issues of image-tools
21+
var IssuesURL = "https://github.com/opencontainers/image-tools/issues"

0 commit comments

Comments
 (0)