Files
LazyPM/cmd/survey.go
2026-02-05 18:18:16 +01:00

42 lines
796 B
Go

package main
import (
"context"
"fmt"
"os"
"github.com/LazyBachelor/LazyPM/pkg"
"github.com/LazyBachelor/LazyPM/pkg/cli"
"github.com/LazyBachelor/LazyPM/pkg/tui"
"github.com/LazyBachelor/LazyPM/pkg/web"
)
func main() {
config := pkg.SurveyConfig{
RootCmd: "pm",
WebAddress: "localhost:8080",
IssuePrefix: "pm",
BeadsDBPath: "./.pm/db.db",
StatisticsStoragePath: "./.pm/stats.json",
}
ctx := context.Background()
var err error
switch os.Args[1] {
case "tui":
err = tui.Run(ctx, config)
case "cli":
err = cli.RunREPL(ctx, config)
case "web":
err = web.Run(ctx, config)
default:
err = fmt.Errorf("unknown command: %s", os.Args[1])
}
if err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}