2023-03-24 20:41:38 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"os"
|
|
|
|
|
2024-06-09 10:44:41 +00:00
|
|
|
"github.com/Luzifer/go_helpers/v2/cli"
|
2023-03-24 20:41:38 +00:00
|
|
|
"github.com/pkg/errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2024-06-09 10:44:41 +00:00
|
|
|
cliTool.Add(cli.RegistryEntry{
|
2023-03-24 20:41:38 +00:00
|
|
|
Name: "actor-docs",
|
|
|
|
Description: "Generate markdown documentation for available actors",
|
2024-02-18 12:42:00 +00:00
|
|
|
Run: func([]string) error {
|
2023-03-24 20:41:38 +00:00
|
|
|
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
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|