cmdflagsfromhost

package
v1.0.0-alpha-64 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListRemoteFlags = map[string]bool{
	"list":    true,
	"log":     true,
	"run":     true,
	"remote":  true,
	"restart": true,
}

ListRemoteFlags hides the globals non used --remote

Functions

func SetLocal

func SetLocal()

SetLocal the context

Types

type Pattern

type Pattern int

Pattern for the host and flags

const (

	// RemotePattern takes only --remote
	RemotePattern Pattern
	// ProjectPattern takes only --project
	ProjectPattern
	// ProjectAndContainerPattern takes only --project and --container
	ProjectAndContainerPattern
	// FullHostPattern takes --project, --container, and --remote
	FullHostPattern
)

type Requires

type Requires struct {
	NoHost    bool
	Auth      bool
	Remote    bool
	Local     bool
	Project   bool
	Container bool
}

Requires configuration for the host and flags

type SetupHost

type SetupHost struct {
	Pattern                         Pattern
	Requires                        Requires
	UseProjectDirectory             bool
	UseProjectDirectoryForContainer bool
	UseContainerDirectory           bool
	// contains filtered or unexported fields
}

SetupHost is the structure for host and flags parsing

func (*SetupHost) Container

func (s *SetupHost) Container() string

Container of the parsed flags or host

func (*SetupHost) Init

func (s *SetupHost) Init(cmd *cobra.Command)

Init flags on a given command

func (*SetupHost) Process

func (s *SetupHost) Process(args []string) error

Process host and flags

func (*SetupHost) Project

func (s *SetupHost) Project() string

Project of the parsed flags or host

func (*SetupHost) Remote

func (s *SetupHost) Remote() string

Remote of the parsed flags or host

func (*SetupHost) RemoteAddress

func (s *SetupHost) RemoteAddress() string

RemoteAddress of the parsed flags or host

Jump to

Keyboard shortcuts

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