30 lines
680 B
Go
30 lines
680 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"flag"
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/google/subcommands"
|
||
|
"within.website/olin/namegen"
|
||
|
)
|
||
|
|
||
|
type namegenCmd struct{}
|
||
|
|
||
|
func (namegenCmd) Name() string { return "namegen" }
|
||
|
func (namegenCmd) Synopsis() string { return "show information about currently logged in user" }
|
||
|
func (namegenCmd) SetFlags(fs *flag.FlagSet) {}
|
||
|
func (namegenCmd) Usage() string {
|
||
|
return `wasmc namegen [options]
|
||
|
|
||
|
$ wasmc namegen
|
||
|
|
||
|
Generates a name with the name generating algorithm.
|
||
|
`
|
||
|
}
|
||
|
|
||
|
func (w namegenCmd) Execute(ctx context.Context, fs *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
|
||
|
fmt.Println(namegen.Next())
|
||
|
return subcommands.ExitSuccess
|
||
|
}
|