Documentation
¶
Index ¶
- Constants
- Variables
- func Add(c Cut, allCuts map[string]Cut) error
- func Command(cutName string, allCuts map[string]Cut, runtimeParams map[string]string) (cmd string, err error)
- func CommandAndValues(cutName string, allCuts map[string]Cut, runtimeParams map[string]string) (cmd string, vals map[string]string, err error)
- func Exec(cutName string, allCuts map[string]Cut, runtimeParams map[string]string) (err error)
- func Load(configJSON io.Reader) (allCuts map[string]Cut, err error)
- func Params(cutName string, allCuts map[string]Cut) (paramsDefinition map[string]string, err error)
- func Save(configJSON io.Writer, allCuts map[string]Cut) (err error)
- type Cut
- type Cuts
Constants ¶
View Source
const ParamRegExp = `#([.-_a-z]+):([a-z]+)#`
Variables ¶
View Source
var Types = []string{"string", "int", "uint", "float", "date", "time", "bool"}
Functions ¶
func CommandAndValues ¶
Types ¶
type Cut ¶
type Cut struct {
Name string `json:name` // names may contain dots to create namespaces (to allow grouping)
Command string `json:command` // a command for the shell. placeholders are defined by inserting something like #Name: Type#, where
// Name is the name of the parameter and Type is one of string, int, uint, float, date, time
// placeholders may have defaults and are asked when the shortcut is executed
// if command starts with a colon, then the followong name is the name of the parent command of which this command is a special case
Defaults map[string]string `json:defaults` // default values
}
Click to show internal directories.
Click to hide internal directories.