Documentation
¶
Overview ¶
Package cli contains CLI commands
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CmdHelp = &Command{ Exec: nil, UsageLine: "help [COMMAND]", Description: "help of the scw command line", Help: ` Help prints help information about scw and its commands. By default, help lists available commands with a short description. When invoked with a command name, it prints the usage and the help of the command. `, }
CmdHelp is the 'scw help' command
View Source
var Commands = []*Command{ CmdHelp, cmdAttach, cmdCommit, cmdCompletion, cmdCp, cmdCreate, cmdEvents, cmdExec, cmdFlushCache, cmdHistory, cmdImages, cmdInfo, cmdInspect, cmdKill, cmdLogin, cmdLogout, cmdLogs, cmdPatch, cmdPort, cmdPs, cmdRename, cmdRestart, cmdRm, cmdRmi, cmdRun, cmdSearch, cmdStart, cmdStop, cmdTag, cmdTop, cmdVersion, cmdWait, }
Commands is the list of enabled CLI commands
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { // Exec executes the command Exec func(cmd *Command, args []string) // Usage is the one-line usage message. UsageLine string // Description is the description of the command Description string // Help is the full description of the command Help string // Examples are some examples of the command Examples string // Flag is a set of flags specific to this command. Flag flag.FlagSet // Hidden is a flat to hide command from global help commands listing Hidden bool // API is the interface used to communicate with Scaleway's API API *api.ScalewayAPI }
Command contains everything needed by the cli main loop to calls the workflow, display help and usage, and the context
func (*Command) ExamplesHelp ¶
ExamplesHelp returns a string describing examples of the command
func (*Command) GetContext ¶
func (c *Command) GetContext(rawArgs []string) commands.CommandContext
GetContext returns a standard context, with real stdin, stdout, stderr, a configured API and raw arguments
func (*Command) PrintShortUsage ¶
func (c *Command) PrintShortUsage()
PrintShortUsage prints a short command usage and exits
func (*Command) PrintUsage ¶
func (c *Command) PrintUsage()
PrintUsage prints a full command usage and exits
Source Files
¶
- attach.go
- command.go
- commands.go
- commit.go
- cp.go
- create.go
- events.go
- exec.go
- help.go
- history.go
- images.go
- info.go
- inspect.go
- kill.go
- login.go
- logout.go
- logs.go
- port.go
- ps.go
- rename.go
- restart.go
- rm.go
- rmi.go
- run.go
- search.go
- start.go
- stop.go
- tag.go
- top.go
- version.go
- wait.go
- x_completion.go
- x_flushcache.go
- x_patch.go
Click to show internal directories.
Click to hide internal directories.