Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package cli contains CLI commands
Index ¶
- Variables
 - func Start(rawArgs []string, streams *commands.Streams) (int, error)
 - type BillingArgs
 - type Command
 - func (c *Command) ExamplesHelp() string
 - func (c *Command) GetContext(rawArgs []string) commands.CommandContext
 - func (c *Command) Name() string
 - func (c *Command) Options() string
 - func (c *Command) PrintShortUsage() error
 - func (c *Command) PrintUsage() error
 - func (c *Command) Streams() *commands.Streams
 
- type CommandListOpts
 
Constants ¶
This section is empty.
Variables ¶
var ( ErrExitFailure = errors.New("exit 1") ErrExitSuccess = errors.New("exit 0") )
errors
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
var Commands = []*Command{ CmdHelp, cmdAttach, cmdCommit, cmdCp, cmdCreate, cmdEvents, cmdExec, cmdHistory, cmdImages, cmdInfo, cmdInspect, cmdKill, cmdLogin, cmdLogout, cmdLogs, cmdPort, cmdPs, cmdRename, cmdRestart, cmdRm, cmdRmi, cmdRun, cmdSearch, cmdStart, cmdStop, cmdTag, cmdTop, cmdUserdata, cmdVersion, cmdWait, cmdBilling, cmdCompletion, cmdFlushCache, cmdMarketplace, cmdPatch, cmdSecurityGroups, cmdIPS, cmdCS, }
Commands is the list of enabled CLI commands
Functions ¶
Types ¶
type BillingArgs ¶ added in v1.5.0
type BillingArgs struct {
	NoTrunc bool
}
    BillingArgs are flags for the `RunBilling` function
type Command ¶
type Command struct {
	// Exec executes the command
	Exec func(cmd *Command, args []string) error
	// 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
	// contains filtered or unexported fields
}
    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 ¶
PrintShortUsage prints a short command usage
func (*Command) PrintUsage ¶
PrintUsage prints a full command usage
type CommandListOpts ¶
type CommandListOpts struct {
	Values *[]string
}
    CommandListOpts holds a list of parameters
func (*CommandListOpts) Set ¶
func (opts *CommandListOpts) Set(value string) error
Set appends a new value to a CommandListOpts
func (*CommandListOpts) String ¶
func (opts *CommandListOpts) String() string
String returns a string representation of a CommandListOpts object
      
      Source Files
      ¶
    
- cmd_attach.go
 - cmd_commit.go
 - cmd_cp.go
 - cmd_create.go
 - cmd_events.go
 - cmd_exec.go
 - cmd_help.go
 - cmd_history.go
 - cmd_images.go
 - cmd_info.go
 - cmd_inspect.go
 - cmd_kill.go
 - cmd_login.go
 - cmd_logout.go
 - cmd_logs.go
 - cmd_port.go
 - cmd_ps.go
 - cmd_rename.go
 - cmd_restart.go
 - cmd_rm.go
 - cmd_rmi.go
 - cmd_run.go
 - cmd_search.go
 - cmd_start.go
 - cmd_stop.go
 - cmd_tag.go
 - cmd_top.go
 - cmd_version.go
 - cmd_wait.go
 - command.go
 - commands.go
 - flags.go
 - main.go
 - test.go
 - x_billing.go
 - x_completion.go
 - x_cs.go
 - x_flushcache.go
 - x_ips.go
 - x_marketplace.go
 - x_patch.go
 - x_security-groups.go
 - x_userdata.go