common

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attach

func Attach(app *cli.App, commands ...basicFunction)

Used to attach subCommands to their relative base commands Ex: `tau new project` project is attached to the new command

Types

type Basic

type Basic interface {
	New() Command
	Edit() Command
	Delete() Command
	Query() Command
	List() Command
	Select() Command
	Clone() Command
	Push() Command
	Pull() Command
	Checkout() Command

	// Sets the following in the command if not already set:
	// Name
	// Aliases
	// Also runs the options provided
	Base() (*cli.Command, []Option)
}

type BeforeHandler

type BeforeHandler interface {
	Shift(method cli.BeforeFunc)
	Push(method cli.BeforeFunc)
}

type Command

type Command interface {
	Raw() *cli.Command
	Parent() *cli.Command
	Options() []Option
	Initialize(parentCommand *cli.Command, baseCommand *cli.Command, baseOps []Option) *cli.Command
}
var NotImplemented Command = nil

func Create

func Create(cmd *cli.Command, ops ...Option) Command

type FlagHandler

type FlagHandler interface {
	Shift(flags ...cli.Flag)
	Push(flags ...cli.Flag)
}

type Linker

type Linker interface {
	Command
	Before() BeforeHandler
	Flags() FlagHandler
}

type Option

type Option func(Linker)

func Base

func Base(cmd *cli.Command, ops ...Option) (*cli.Command, []Option)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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