Merge pull request #87 from rakyll/ctr-readability

Do not export symbols from the main package
This commit is contained in:
Michael Crosby 2016-01-25 14:18:56 -08:00
commit daaa7096a0
4 changed files with 23 additions and 23 deletions

View file

@ -10,17 +10,17 @@ import (
netcontext "golang.org/x/net/context" netcontext "golang.org/x/net/context"
) )
var CheckpointCommand = cli.Command{ var checkpointCommand = cli.Command{
Name: "checkpoints", Name: "checkpoints",
Usage: "list all checkpoints", Usage: "list all checkpoints",
Subcommands: []cli.Command{ Subcommands: []cli.Command{
ListCheckpointCommand, listCheckpointCommand,
CreateCheckpointCommand, createCheckpointCommand,
}, },
Action: listCheckpoints, Action: listCheckpoints,
} }
var ListCheckpointCommand = cli.Command{ var listCheckpointCommand = cli.Command{
Name: "list", Name: "list",
Usage: "list all checkpoints for a container", Usage: "list all checkpoints for a container",
Action: listCheckpoints, Action: listCheckpoints,
@ -50,7 +50,7 @@ func listCheckpoints(context *cli.Context) {
} }
} }
var CreateCheckpointCommand = cli.Command{ var createCheckpointCommand = cli.Command{
Name: "create", Name: "create",
Usage: "create a new checkpoint for the container", Usage: "create a new checkpoint for the container",
Flags: []cli.Flag{ Flags: []cli.Flag{
@ -94,7 +94,7 @@ var CreateCheckpointCommand = cli.Command{
}, },
} }
var DeleteCheckpointCommand = cli.Command{ var deleteCheckpointCommand = cli.Command{
Name: "delete", Name: "delete",
Usage: "delete a container's checkpoint", Usage: "delete a container's checkpoint",
Action: func(context *cli.Context) { Action: func(context *cli.Context) {

View file

@ -36,20 +36,20 @@ func getClient(ctx *cli.Context) types.APIClient {
return types.NewAPIClient(conn) return types.NewAPIClient(conn)
} }
var ContainersCommand = cli.Command{ var containersCommand = cli.Command{
Name: "containers", Name: "containers",
Usage: "interact with running containers", Usage: "interact with running containers",
Subcommands: []cli.Command{ Subcommands: []cli.Command{
ExecCommand, execCommand,
KillCommand, killCommand,
ListCommand, listCommand,
StartCommand, startCommand,
StatsCommand, statsCommand,
}, },
Action: listContainers, Action: listContainers,
} }
var ListCommand = cli.Command{ var listCommand = cli.Command{
Name: "list", Name: "list",
Usage: "list all running containers", Usage: "list all running containers",
Action: listContainers, Action: listContainers,
@ -71,7 +71,7 @@ func listContainers(context *cli.Context) {
} }
} }
var StartCommand = cli.Command{ var startCommand = cli.Command{
Name: "start", Name: "start",
Usage: "start a container", Usage: "start a container",
Flags: []cli.Flag{ Flags: []cli.Flag{
@ -239,7 +239,7 @@ func attachStdio(stdins, stdout, stderr *string) error {
return nil return nil
} }
var KillCommand = cli.Command{ var killCommand = cli.Command{
Name: "kill", Name: "kill",
Usage: "send a signal to a container or its processes", Usage: "send a signal to a container or its processes",
Flags: []cli.Flag{ Flags: []cli.Flag{
@ -269,7 +269,7 @@ var KillCommand = cli.Command{
}, },
} }
var ExecCommand = cli.Command{ var execCommand = cli.Command{
Name: "exec", Name: "exec",
Usage: "exec another process in an existing container", Usage: "exec another process in an existing container",
Flags: []cli.Flag{ Flags: []cli.Flag{
@ -356,7 +356,7 @@ var ExecCommand = cli.Command{
}, },
} }
var StatsCommand = cli.Command{ var statsCommand = cli.Command{
Name: "stats", Name: "stats",
Usage: "get stats for running container", Usage: "get stats for running container",
Action: func(context *cli.Context) { Action: func(context *cli.Context) {

View file

@ -10,7 +10,7 @@ import (
netcontext "golang.org/x/net/context" netcontext "golang.org/x/net/context"
) )
var EventsCommand = cli.Command{ var eventsCommand = cli.Command{
Name: "events", Name: "events",
Usage: "receive events from the containerd daemon", Usage: "receive events from the containerd daemon",
Action: func(context *cli.Context) { Action: func(context *cli.Context) {

View file

@ -9,13 +9,13 @@ import (
"github.com/docker/containerd" "github.com/docker/containerd"
) )
const Usage = `High performance container daemon cli` const usage = `High performance container daemon cli`
func main() { func main() {
app := cli.NewApp() app := cli.NewApp()
app.Name = "ctr" app.Name = "ctr"
app.Version = containerd.Version app.Version = containerd.Version
app.Usage = Usage app.Usage = usage
app.Authors = []cli.Author{ app.Authors = []cli.Author{
{ {
Name: "@crosbymichael", Name: "@crosbymichael",
@ -34,9 +34,9 @@ func main() {
}, },
} }
app.Commands = []cli.Command{ app.Commands = []cli.Command{
CheckpointCommand, checkpointCommand,
ContainersCommand, containersCommand,
EventsCommand, eventsCommand,
} }
app.Before = func(context *cli.Context) error { app.Before = func(context *cli.Context) error {
if context.GlobalBool("debug") { if context.GlobalBool("debug") {