config

package
v0.0.0-...-bb167ce Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: EPL-1.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Dest       string   `long:"dest" description:"The directory where to output the new project." env:"GRILLER_DEST"`
	Remote     string   `long:"remote" description:"Go repo location.  Example: github.com/lcaballero" required:"true" env:"GRILLER_REMOTE"`
	Debug      bool     `long:"debug" description:"Turns on debug mode which outputs additional information to standard out."`
	List       Lister   `command:"list" description:"Lists the names of the available templates."`
	Template   Template `command:"template" description:"Generate a boiler plate project from a named template. (See list command)"`
	ShowValues bool     `long:"show-values" description:"Shows the values parsed from the command line then exits."`
	// contains filtered or unexported fields
}

Conf represents values exported from the command line.

func ParseArgs

func ParseArgs(params []string) (*Conf, *flags.Parser, error)

ParseArgs takes in the command line tokens (minus the first) and returns a new Conf based on the values parsed, a parser used to parse those values and an error if one should occur during the parsing phase. If an error does occur then the parse provided can be used to show the help/usage.

func (*Conf) String

func (c *Conf) String() string

String provides and easy way to visualize the conf structure as it was parsed from the command line.

type Lister

type Lister struct {
	Type string `long:"type" default:"all"`
	// contains filtered or unexported fields
}

Lister represents the List command from the cli.

func (Lister) IsActive

func (t Lister) IsActive() bool

IsActive indicates (when true) that this command is the command issued at the command line rather than any of the other values.

type Template

type Template struct {
	Name    string `long:"template-name" description:"The name of the template to run." required:"1"`
	Project string `long:"project" description:"Both the project name, and name of the directory for the newly created go project." required:"2"`
	// contains filtered or unexported fields
}

Template represets the template command from the cli

func (Template) IsActive

func (t Template) IsActive() bool

IsActive indicates that a template command was issued at the command line.

Jump to

Keyboard shortcuts

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