| 1 |
package commands |
| 2 |
|
| 3 |
import ( |
| 4 |
"git.sr.ht/~rjarry/aerc/app" |
| 5 |
) |
| 6 |
|
| 7 |
type Echo struct { |
| 8 |
Template string `opt:"..." required:"false"` |
| 9 |
} |
| 10 |
|
| 11 |
func init() { |
| 12 |
Register(Echo{}) |
| 13 |
} |
| 14 |
|
| 15 |
func (Echo) Description() string { |
| 16 |
return "Print text after template expansion." |
| 17 |
} |
| 18 |
|
| 19 |
func (Echo) Aliases() []string { |
| 20 |
return []string{"echo"} |
| 21 |
} |
| 22 |
|
| 23 |
func (Echo) Context() CommandContext { |
| 24 |
return GLOBAL |
| 25 |
} |
| 26 |
|
| 27 |
func (e Echo) Execute(args []string) error { |
| 28 |
app.PushSuccess(e.Template) |
| 29 |
return nil |
| 30 |
} |