cli

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Command      string
	Local        HostInput
	Remote       HostInput
	Server       HostInput
	Key          string
	Verbose      bool
	Help         bool
	Version      bool
	Alias        string
	Start        string
	AliasDelete  bool
	Detach       bool
	Stop         string
	AliasList    bool
	InsecureMode bool
	// contains filtered or unexported fields
}

App contains main settings of application.

func New

func New(args []string) *App

New creates a new instance of App.

func (*App) Parse

func (c *App) Parse() error

Parse grabs arguments and flags from CLI.

func (*App) PrintUsage

func (c *App) PrintUsage()

PrintUsage prints, to the standard output, the informational text on how to use the tool.

func (App) String

func (c App) String() string

String returns a string representation of an App.

func (App) Validate added in v0.3.0

func (c App) Validate() error

Validate checks parsed params.

type HostInput

type HostInput struct {
	User string
	Host string
	Port string
}

HostInput holds information about a host

func (HostInput) Address

func (h HostInput) Address() string

Address returns a string representation of HostInput to be used to perform network connections.

func (*HostInput) Set

func (h *HostInput) Set(value string) error

Set parses a string representation of HostInput into its proper attributes.

func (HostInput) String

func (h HostInput) String() string

String returns a string representation of a HostInput

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL