summaryrefslogtreecommitdiff
path: root/runner
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-22 17:09:06 +0200
committerewy <ewy0@protonmail.com>2026-04-22 17:09:06 +0200
commit615889e00e744f76a8e4e1bade2367bde8598878 (patch)
tree7eee15a91138426b9d9691b6af8456d98442e1d4 /runner
parentc09ad2afa420b0e4a558bf05a0672d5f9785d3ad (diff)
add "invocation" method which expects a target to output its own magic spell
Diffstat (limited to 'runner')
-rw-r--r--runner/base.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/runner/base.go b/runner/base.go
index 28ea4d5..7435fd7 100644
--- a/runner/base.go
+++ b/runner/base.go
@@ -22,6 +22,7 @@ func (t *BaseTarget) Matches(input string) bool {
func (t *BaseTarget) ShortestId() string {
return t.Reduced
}
+func (b *BaseTarget) Invocation(src *model.Source) []string {
func Hydrated[T model.Target](in T) BaseHydration[T] {
return BaseHydration[T]{
@@ -53,6 +54,10 @@ func (b BaseHydration[T]) Hydrate(src *model.Source) (model.HydratedTarget, erro
return b, nil
}
+func (b BaseHydration[T]) Invocation(src *model.Source) []string {
+ return b.BaseTarget.Invocation(src)
+}
+
func (b BaseHydration[T]) Visible() bool {
return b.BaseTarget.Visible()
}