Select Git revision
To find the state of this project's repository at the time of any of these versions, check out the tags.
main.go 933 B
// Package main is the main program for bulletin.
// It is based off the 1989 version of bulletin.
package main
import (
"context"
"fmt"
"os"
"git.lyda.ie/kevin/bulletin/accounts"
"git.lyda.ie/kevin/bulletin/repl"
"github.com/urfave/cli/v3"
)
func main() {
cmd := &cli.Command{
Name: "bulletin",
Usage: "a bulletin system",
Description: "An interpretation of the VMS BULLETIN program.",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "user",
Aliases: []string{"u"},
Usage: "user to run bulletin as",
Value: "",
Required: true,
},
},
Action: func(_ context.Context, cmd *cli.Command) error {
user := cmd.String("user")
err := accounts.Open(user)
if err != nil {
return err
}
err = repl.Loop(user)
if err != nil {
return err
}
return nil
},
}
err := cmd.Run(context.Background(), os.Args)
if err != nil {
fmt.Println(err)
}
}