diff --git a/ctr/container.go b/ctr/container.go index 7125a7171..900e707be 100644 --- a/ctr/container.go +++ b/ctr/container.go @@ -28,10 +28,11 @@ var ContainersCommand = cli.Command{ Name: "containers", Usage: "interact with running containers", Subcommands: []cli.Command{ - StartCommand, - ListCommand, - KillCommand, ExecCommand, + KillCommand, + ListCommand, + StartCommand, + StatsCommand, }, Action: listContainers, } @@ -234,15 +235,9 @@ var ExecCommand = cli.Command{ var StatsCommand = cli.Command{ Name: "stats", Usage: "get stats for running container", - Flags: []cli.Flag{ - cli.StringFlag{ - Name: "id", - Usage: "container id", - }, - }, Action: func(context *cli.Context) { req := &types.StatsRequest{ - Id: context.String("id"), + Id: context.Args().First(), } c := getClient() stream, err := c.GetStats(netcontext.Background(), req) diff --git a/ctr/main.go b/ctr/main.go index 8d27bafe5..632f16866 100644 --- a/ctr/main.go +++ b/ctr/main.go @@ -37,7 +37,6 @@ func main() { CheckpointCommand, ContainersCommand, EventsCommand, - StatsCommand, } app.Before = func(context *cli.Context) error { if context.GlobalBool("debug") {