wasmcloud/cmd/wasmc/namegen.go

30 lines
680 B
Go
Raw Normal View History

2019-11-19 23:56:39 +00:00
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
}