cmds

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenCommands

func GenCommands(config *configs.XDConfig) []cli.Command

GenCommands generates the commands from the config

func ProcessCmd

func ProcessCmd(parsedCmd ParsedCmd, params map[string]string) (string, error)

ProcessCmd is processing the command to make it executable

func ReadFlags

func ReadFlags(parsedCmd ParsedCmd) []cli.Flag

ReadFlags reads the Flag defined in the ParsedCmd

func ReadParams

func ReadParams(parsedCmd ParsedCmd, c *cli.Context) map[string]string

ReadParams reads the params definied in the ParsedCmd from the cli context

func RunCmd

func RunCmd(cmd string)

RunCmd the specified command

Types

type ParsedCmd

type ParsedCmd struct {
	Text string
	Vars []Variable
}

ParsedCmd is a command and all its extracted information

func ParseCmd

func ParseCmd(cmd string) ParsedCmd

ParseCmd is parsing the command and extracting revelent information

type Variable

type Variable struct {
	Expression string
	Name       string
	Value      string
}

Variable is a part of the command that will be replaced when called

Jump to

Keyboard shortcuts

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