with about plugins

This commit is contained in:
2022-11-02 22:10:15 +01:00
parent e59a87c43a
commit c6fd666f64
13 changed files with 250 additions and 46 deletions

18
main.go
View File

@@ -1,13 +1,29 @@
package main
import (
"context"
"errors"
"log"
"git.front.kjuulh.io/kjuulh/char/cmd/char"
"git.front.kjuulh.io/kjuulh/char/pkg/charcontext"
)
func main() {
if err := char.NewCharCmd().Execute(); err != nil {
charctx, err := charcontext.NewCharContext(context.Background())
if err != nil {
if errors.Is(err, charcontext.ErrNoContextFound) {
log.Print("you are not in a char context, as such you will be presented with limited options")
if err := char.NewLimitedCharCmd().Execute(); err != nil {
log.Fatal(err)
}
} else {
log.Fatal(err)
}
}
defer charctx.Close()
if err := char.NewCharCmd(charctx).Execute(); err != nil {
log.Fatal(err)
}
}