twitch-bot/cli_actorDocs.go
Knut Ahlers d8c6f8d221
[core] Split out cli commands
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-03-24 21:41:38 +01:00

26 lines
527 B
Go

package main
import (
"bytes"
"os"
"github.com/pkg/errors"
)
func init() {
cli.Add(cliRegistryEntry{
Name: "actor-docs",
Description: "Generate markdown documentation for available actors",
Run: func(args []string) error {
doc, err := generateActorDocs()
if err != nil {
return errors.Wrap(err, "generating actor docs")
}
if _, err = os.Stdout.Write(append(bytes.TrimSpace(doc), '\n')); err != nil {
return errors.Wrap(err, "writing actor docs to stdout")
}
return nil
},
})
}