cli

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: MIT Imports: 33 Imported by: 0

README

CLI

Installation

$ go get github.com/gobuffalo/buffalo-cli/v2/cmd/buffalo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aliases

type Aliases = plugins.Aliases

type Buffalo

type Buffalo struct {
	plugins.Plugins
}

Buffalo represents the `buffalo` cli.

func New

func New() (*Buffalo, error)

func NewFromRoot

func NewFromRoot(root string) (*Buffalo, error)

func (Buffalo) Description

func (Buffalo) Description() string

Description ...

func (*Buffalo) Main

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

Main is the entry point of the `buffalo` command

func (Buffalo) PluginName

func (Buffalo) PluginName() string

Name ...

func (Buffalo) ScopedPlugins

func (b Buffalo) ScopedPlugins() []plugins.Plugin

func (Buffalo) String

func (Buffalo) String() string

func (Buffalo) SubCommands

func (b Buffalo) SubCommands() []plugins.Plugin

type Command

type Command interface {
	plugins.Plugin
	Main(ctx context.Context, root string, args []string) error
}

Command represents a plugin that can be used as a full sub-command. Like Go program's the `Main` method is called to run that command.

type Commands

type Commands []Command

Commands is a slice of type `Command`

func (Commands) Find

func (commands Commands) Find(name string) (Command, error)

Find will try and find the given command in the slice by it's `Aliases()` or `Name()` method. If it can't be found an error is returned.

Jump to

Keyboard shortcuts

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