Skip to content
Snippets Groups Projects
Select Git revision
  • 8f4180366d4a5541f7042d24a1fc424b26e41bb9
  • master default protected
  • commit-alias
  • editor-modeline
  • commit-abbreviation
  • make-hooks-work-as-advertised
  • lyda-home-version
  • feature-aliases
  • git-version-bsd-fix
  • hook-changes
  • v1.20151229-1
  • v1.20151229
  • v1.20150502-1
  • v1.20150502
  • v1.20141026-manpage-static
  • v1.20141026-1
  • v1.20141026
  • v1.20141025-1
  • v1.20141025
  • v1.20141009-manpage-static
  • v1.20141009-1
  • v1.20141009
  • v1.20140508-1-bpo70+1
  • v1.20140508-1
  • v1.20140508-manpage-static
  • v1.20140508
  • v1.20140507
  • v1.20140313
  • v1.20131229-homebrew
  • v1.20131229-1-bpo60+1
30 results

changelog

Blame
  • 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)
    	}
    }