blob: 156ee470b86930a037d04cae1bbb9e1d58d8bc74 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package model
import (
"os/exec"
)
// Target is something we want to run
type Target interface {
Matches
// Create creates the exec.Cmd from itself. The model.Source this target is in is also available.
Create(s *Source) *exec.Cmd
Sub() []string
// Label will be used for its label in the menu
Label() string
Hydrate(src *Source) (HydratedTarget, error)
Tags() Tags
// ShortestId returns a short version of its identity
ShortestId() string
// Visible should return whether this target can be seen in the menu
Visible() bool
// Invocation should return the "canonical invocation": simple to remember
Invocation(src *Source) []string
File(src *Source) string
}
// HydratedTarget is something we want to show in the menu
type HydratedTarget interface {
// Icon is some text which will be used as an icon
Icon() string
// Description is a one-line description of what this does
Description(src *HydratedSource) string
// Target returns our inner target
Target() Target
}
|