package cli

import "github.com/dotcloud/docker/cli"

Index

Variables

var DockerCommands = make(map[string]Command)

DockerCommands stores all the docker command

Functions

func Subcmd

func Subcmd(name string, synopses []string, description string, exitOnError bool) *flag.FlagSet

Subcmd is a subcommand of the main "docker" command. A subcommand represents an action that can be performed from the Docker command line client.

To see all available subcommands, run "docker --help".

Types

type Cli

type Cli struct {
	Stderr io.Writer

	Usage func()
	// contains filtered or unexported fields
}

Cli represents a command line interface.

func New

func New(handlers ...Handler) *Cli

New instantiates a ready-to-use Cli.

func (*Cli) CmdHelp

func (cli *Cli) CmdHelp(args ...string) error

CmdHelp displays information on a Docker command.

If more than one command is specified, information is only shown for the first command.

Usage: docker help COMMAND or docker COMMAND --help

func (*Cli) Run

func (cli *Cli) Run(args ...string) error

Run executes the specified command.

type ClientFlags

type ClientFlags struct {
	FlagSet   *flag.FlagSet
	Common    *CommonFlags
	PostParse func()

	ConfigDir string
}

ClientFlags represents flags for the docker client.

type Command

type Command struct {
	Name        string
	Description string
}

Command is the struct contains command name and description

type CommonFlags

type CommonFlags struct {
	FlagSet   *flag.FlagSet
	PostParse func()

	Debug      bool
	Hosts      []string
	LogLevel   string
	TLS        bool
	TLSVerify  bool
	TLSOptions *tlsconfig.Options
	TrustKey   string
}

CommonFlags represents flags that are common to both the client and the daemon.

type Handler

type Handler interface{}

Handler holds the different commands Cli will call It should have methods with names starting with `Cmd` like:

func (h myHandler) CmdFoo(args ...string) error

type Initializer

type Initializer interface {
	Initialize() error
}

Initializer can be optionally implemented by a Handler to initialize before each call to one of its commands.

type StatusError

type StatusError struct {
	Status     string
	StatusCode int
}

An StatusError reports an unsuccessful exit by a command.

func (StatusError) Error

func (e StatusError) Error() string

Source Files

cli.go client.go common.go

Version
v1.10.1-rc1
Published
Feb 10, 2016
Platform
js/wasm
Imports
8 packages
Last checked
6 seconds ago

Tools for package owners.