Merge pull request #959 from stevvooe/image-command-layout

cmd/dist: better organization and aliases for image command
This commit is contained in:
Stephen Day 2017-06-05 14:01:21 -07:00 committed by GitHub
commit 2a6731f0d2
2 changed files with 16 additions and 14 deletions

21
cmd/dist/images.go vendored
View File

@ -12,9 +12,19 @@ import (
"github.com/urfave/cli"
)
var imageCommand = cli.Command{
Name: "images",
Aliases: []string{"images"},
Usage: "image management",
Subcommands: cli.Commands{
imagesListCommand,
imageRemoveCommand,
},
}
var imagesListCommand = cli.Command{
Name: "list",
Aliases: []string{"images"},
Aliases: []string{"ls"},
Usage: "list images known to containerd",
ArgsUsage: "[flags] <ref>",
Description: `List images registered with containerd.`,
@ -54,11 +64,12 @@ var imagesListCommand = cli.Command{
},
}
var rmiCommand = cli.Command{
Name: "rmi",
Usage: "Delete one or more images by reference.",
var imageRemoveCommand = cli.Command{
Name: "remove",
Aliases: []string{"rm"},
Usage: "Remove one or more images by reference.",
ArgsUsage: "[flags] <ref> [<ref>, ...]",
Description: `Delete one or more images by reference.`,
Description: `Remove one or more images by reference.`,
Flags: []cli.Flag{},
Action: func(clicontext *cli.Context) error {
var (

9
cmd/dist/main.go vendored
View File

@ -93,15 +93,6 @@ distribution tool
}
}
var imageCommand = cli.Command{
Name: "image",
Usage: "image management",
Subcommands: cli.Commands{
imagesListCommand,
rmiCommand,
},
}
var contentCommand = cli.Command{
Name: "content",
Usage: "content management",