mirror of
https://github.com/containers/skopeo.git
synced 2025-06-28 15:47:34 +00:00
Improve --help output
- Use ArgsUsage to document the non-option arguments - Refer to ArgsUsage placeholders in Usage - Use named placeholders in flag documentation Fixes #137, more or less.
This commit is contained in:
parent
68faefed61
commit
8a239596a9
@ -162,13 +162,15 @@ func copyHandler(context *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var copyCmd = cli.Command{
|
var copyCmd = cli.Command{
|
||||||
Name: "copy",
|
Name: "copy",
|
||||||
Action: copyHandler,
|
Usage: "Copy an image from one location to another",
|
||||||
|
ArgsUsage: "SOURCE-IMAGE DESTINATION-IMAGE",
|
||||||
|
Action: copyHandler,
|
||||||
// FIXME: Do we need to namespace the GPG aspect?
|
// FIXME: Do we need to namespace the GPG aspect?
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "sign-by",
|
Name: "sign-by",
|
||||||
Usage: "sign the image using a GPG key with the specified fingerprint",
|
Usage: "Sign the image using a GPG key with the specified `FINGERPRINT`",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,8 @@ func deleteHandler(context *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var deleteCmd = cli.Command{
|
var deleteCmd = cli.Command{
|
||||||
Name: "delete",
|
Name: "delete",
|
||||||
Usage: "Delete given image",
|
Usage: "Delete image IMAGE-NAME",
|
||||||
Action: deleteHandler,
|
ArgsUsage: "IMAGE-NAME",
|
||||||
|
Action: deleteHandler,
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,9 @@ type inspectOutput struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var inspectCmd = cli.Command{
|
var inspectCmd = cli.Command{
|
||||||
Name: "inspect",
|
Name: "inspect",
|
||||||
Usage: "inspect images on a registry",
|
Usage: "Inspect image IMAGE-NAME",
|
||||||
|
ArgsUsage: "IMAGE-NAME",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "raw",
|
Name: "raw",
|
||||||
|
@ -12,8 +12,9 @@ import (
|
|||||||
|
|
||||||
// TODO(runcom): document args and usage
|
// TODO(runcom): document args and usage
|
||||||
var layersCmd = cli.Command{
|
var layersCmd = cli.Command{
|
||||||
Name: "layers",
|
Name: "layers",
|
||||||
Usage: "get images layers",
|
Usage: "Get layers of IMAGE-NAME",
|
||||||
|
ArgsUsage: "IMAGE-NAME",
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
rawSource, err := parseImageSource(c, c.Args()[0])
|
rawSource, err := parseImageSource(c, c.Args()[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -13,10 +13,6 @@ import (
|
|||||||
// and will be populated by the Makefile
|
// and will be populated by the Makefile
|
||||||
var gitCommit = ""
|
var gitCommit = ""
|
||||||
|
|
||||||
const (
|
|
||||||
usage = `interact with registries`
|
|
||||||
)
|
|
||||||
|
|
||||||
// createApp returns a cli.App to be run or tested.
|
// createApp returns a cli.App to be run or tested.
|
||||||
func createApp() *cli.App {
|
func createApp() *cli.App {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
@ -26,7 +22,7 @@ func createApp() *cli.App {
|
|||||||
} else {
|
} else {
|
||||||
app.Version = version.Version
|
app.Version = version.Version
|
||||||
}
|
}
|
||||||
app.Usage = usage
|
app.Usage = "Various operations with container images and container image registries"
|
||||||
// TODO(runcom)
|
// TODO(runcom)
|
||||||
//app.EnableBashCompletion = true
|
//app.EnableBashCompletion = true
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
@ -37,21 +33,21 @@ func createApp() *cli.App {
|
|||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "username",
|
Name: "username",
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "registry username",
|
Usage: "use `USERNAME` for accessing the registry",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "password",
|
Name: "password",
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "registry password",
|
Usage: "use `PASSWORD` for accessing the registry",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "cert-path",
|
Name: "cert-path",
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Certificates path to connect to the given registry (cert.pem, key.pem)",
|
Usage: "use certificates at `PATH` (cert.pem, key.pem) to connect to the registry",
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "tls-verify",
|
Name: "tls-verify",
|
||||||
Usage: "Whether to verify certificates or not",
|
Usage: "verify certificates",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
app.Before = func(c *cli.Context) error {
|
app.Before = func(c *cli.Context) error {
|
||||||
|
@ -39,13 +39,14 @@ func standaloneSign(context *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var standaloneSignCmd = cli.Command{
|
var standaloneSignCmd = cli.Command{
|
||||||
Name: "standalone-sign",
|
Name: "standalone-sign",
|
||||||
Usage: "Create a signature using local files",
|
Usage: "Create a signature using local files",
|
||||||
Action: standaloneSign,
|
ArgsUsage: "MANIFEST DOCKER-REFERENCE KEY-FINGERPRINT",
|
||||||
|
Action: standaloneSign,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "output, o",
|
Name: "output, o",
|
||||||
Usage: "output signature file name",
|
Usage: "output the signature to `SIGNATURE`",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -82,7 +83,8 @@ func standaloneVerify(context *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var standaloneVerifyCmd = cli.Command{
|
var standaloneVerifyCmd = cli.Command{
|
||||||
Name: "standalone-verify",
|
Name: "standalone-verify",
|
||||||
Usage: "Verify a signature using local files",
|
Usage: "Verify a signature using local files",
|
||||||
Action: standaloneVerify,
|
ArgsUsage: "MANIFEST DOCKER-REFERENCE KEY-FINGERPRINT SIGNATURE",
|
||||||
|
Action: standaloneVerify,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user