cli

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFlagSet added in v0.5.0

func NewFlagSet(name string) *flag.FlagSet

Types

type Buffalo added in v0.4.1

type Buffalo struct {
	context.Context

	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
	Plugins Plugins
	// contains filtered or unexported fields
}

Buffalo represents the `buffalo` cli.

func New added in v0.4.1

func New(ctx context.Context) (*Buffalo, error)

func (*Buffalo) Fix added in v0.5.0

func (b *Buffalo) Fix(ctx context.Context, args []string) error

func (*Buffalo) Flags added in v0.4.1

func (b *Buffalo) Flags() *flag.FlagSet

func (*Buffalo) Main added in v0.4.1

func (b *Buffalo) Main(ctx context.Context, args []string) error

type Fixer added in v0.4.1

type Fixer interface {
	Fix(ctx context.Context, args []string) error
}

Fixer is an optional interface a plugin can implement to be run with `buffalo fix`. This should update the application to the current version of the plugin. The expectation is fixing of only one major revision.

type Generator added in v0.4.1

type Generator interface {
	Generate(ctx context.Context, args []string) error
}

Fixer is an optional interface a plugin can implement to be run with `buffalo fix`

type Plugin added in v0.4.1

type Plugin interface {
	// Name is the name of the plugin.
	// This will also be used for the cli sub-command
	// 	"pop" | "heroku" | "auth" | etc...
	Name() string
}

Plugin is the most basic interface a plugin can implement.

type Plugins added in v0.4.1

type Plugins []Plugin

func (Plugins) Fix added in v0.4.1

func (plugs Plugins) Fix(ctx context.Context, args []string) error

Fix runs any Fixers that are in the Plugins. If no arguments are provided it will run all fixers in the Plugins. Otherwise Fix will run the fixers for the arguments provided.

buffalo fix
buffalo fix plush pop
buffalo fix -h

func (Plugins) Generate added in v0.4.1

func (plugs Plugins) Generate(ctx context.Context, args []string) error

Generate will run the specified generator.

buffalo generate -h
buffalo generate pop ...

func (Plugins) Len added in v0.4.1

func (plugs Plugins) Len() int

Len is the number of elements in the collection.

func (Plugins) Less added in v0.4.1

func (plugs Plugins) Less(i int, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (Plugins) Swap added in v0.4.1

func (plugs Plugins) Swap(i int, j int)

Swap swaps the elements with indexes i and j.

Jump to

Keyboard shortcuts

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