ctr: snapshot->snapshots cmd, add aliases

Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
This commit is contained in:
Jess Valarezo 2017-11-22 14:24:25 -05:00
parent 59bd196711
commit 61c8fe2307
8 changed files with 21 additions and 16 deletions

View File

@ -18,7 +18,7 @@ import (
var Command = cli.Command{ var Command = cli.Command{
Name: "containers", Name: "containers",
Usage: "manage containers", Usage: "manage containers",
Aliases: []string{"c"}, Aliases: []string{"c", "container"},
Subcommands: []cli.Command{ Subcommands: []cli.Command{
deleteCommand, deleteCommand,
infoCommand, infoCommand,

View File

@ -15,8 +15,9 @@ import (
// Command is the cli command for displaying containerd events // Command is the cli command for displaying containerd events
var Command = cli.Command{ var Command = cli.Command{
Name: "events", Name: "events",
Usage: "display containerd events", Aliases: []string{"event"},
Usage: "display containerd events",
Action: func(context *cli.Context) error { Action: func(context *cli.Context) error {
client, ctx, cancel, err := commands.NewClient(context) client, ctx, cancel, err := commands.NewClient(context)
if err != nil { if err != nil {

View File

@ -19,8 +19,9 @@ import (
// Command is the cli command for managing images // Command is the cli command for managing images
var Command = cli.Command{ var Command = cli.Command{
Name: "images", Name: "images",
Usage: "manage images", Aliases: []string{"image"},
Usage: "manage images",
Subcommands: cli.Commands{ Subcommands: cli.Commands{
checkCommand, checkCommand,
exportCommand, exportCommand,

View File

@ -16,8 +16,9 @@ import (
// Command is the cli command for managing namespaces // Command is the cli command for managing namespaces
var Command = cli.Command{ var Command = cli.Command{
Name: "namespaces", Name: "namespaces",
Usage: "manage namespaces", Aliases: []string{"namespace"},
Usage: "manage namespaces",
Subcommands: cli.Commands{ Subcommands: cli.Commands{
createCommand, createCommand,
listCommand, listCommand,

View File

@ -18,8 +18,9 @@ import (
// Command is a cli command that outputs plugin information // Command is a cli command that outputs plugin information
var Command = cli.Command{ var Command = cli.Command{
Name: "plugins", Name: "plugins",
Usage: "provides information about containerd plugins", Aliases: []string{"plugin"},
Usage: "provides information about containerd plugins",
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
Name: "quiet,q", Name: "quiet,q",

View File

@ -1,4 +1,4 @@
package snapshot package snapshots
import ( import (
gocontext "context" gocontext "context"
@ -19,9 +19,10 @@ import (
// Command is the cli command for managing snapshots // Command is the cli command for managing snapshots
var Command = cli.Command{ var Command = cli.Command{
Name: "snapshot", Name: "snapshots",
Usage: "manage snapshots", Aliases: []string{"snapshot"},
Flags: commands.SnapshotterFlags, Usage: "manage snapshots",
Flags: commands.SnapshotterFlags,
Subcommands: cli.Commands{ Subcommands: cli.Commands{
commitCommand, commitCommand,
infoCommand, infoCommand,

View File

@ -14,7 +14,7 @@ type resizer interface {
var Command = cli.Command{ var Command = cli.Command{
Name: "tasks", Name: "tasks",
Usage: "manage tasks", Usage: "manage tasks",
Aliases: []string{"t"}, Aliases: []string{"t", "task"},
Subcommands: []cli.Command{ Subcommands: []cli.Command{
attachCommand, attachCommand,
checkpointCommand, checkpointCommand,

View File

@ -14,7 +14,7 @@ import (
"github.com/containerd/containerd/cmd/ctr/commands/plugins" "github.com/containerd/containerd/cmd/ctr/commands/plugins"
"github.com/containerd/containerd/cmd/ctr/commands/pprof" "github.com/containerd/containerd/cmd/ctr/commands/pprof"
"github.com/containerd/containerd/cmd/ctr/commands/run" "github.com/containerd/containerd/cmd/ctr/commands/run"
"github.com/containerd/containerd/cmd/ctr/commands/snapshot" "github.com/containerd/containerd/cmd/ctr/commands/snapshots"
"github.com/containerd/containerd/cmd/ctr/commands/tasks" "github.com/containerd/containerd/cmd/ctr/commands/tasks"
versionCmd "github.com/containerd/containerd/cmd/ctr/commands/version" versionCmd "github.com/containerd/containerd/cmd/ctr/commands/version"
"github.com/containerd/containerd/defaults" "github.com/containerd/containerd/defaults"
@ -84,7 +84,7 @@ containerd CLI
namespacesCmd.Command, namespacesCmd.Command,
pprof.Command, pprof.Command,
run.Command, run.Command,
snapshot.Command, snapshots.Command,
tasks.Command, tasks.Command,
}, extraCmds...) }, extraCmds...)
app.Before = func(context *cli.Context) error { app.Before = func(context *cli.Context) error {