diff options
| author | ewy <ewy0@protonmail.com> | 2026-04-22 22:06:24 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-04-22 22:06:24 +0200 |
| commit | 1e8cedca4d03829fadd532e9c5980dbb0eeab4bb (patch) | |
| tree | 90745c56ab9c3feec790ba001683a19f4e360eb8 /model/target.go | |
| parent | d88661935fa2b6e2c0fe93345800113e1a71b451 (diff) | |
docs
Diffstat (limited to 'model/target.go')
| -rw-r--r-- | model/target.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/model/target.go b/model/target.go index b503381..683ab8f 100644 --- a/model/target.go +++ b/model/target.go @@ -4,21 +4,31 @@ 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 } +// HydratedTarget is something we want to show in the menu type HydratedTarget interface { Target + // Icon is some text which will be used as an icon Icon() string + // Description is a one-line description of what this does Description() string + // Target returns our inner target Target() Target } |
