commands

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2025 License: Artistic-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CoinflipCommand = &cli.Command{
	Name:   "coinflip",
	Usage:  "Make your pet flip a coin",
	Action: coinfilp,
}
View Source
var DispatchCommand = &cli.Command{
	Name:   "dispatch",
	Usage:  "Dispatch a message to a service. Only Slack supported atm",
	Action: dispatch,
}
View Source
var FeedCommand = &cli.Command{
	Name:   "feed",
	Usage:  "Feed the pet",
	Action: feed,
}
View Source
var GreetCommand = &cli.Command{
	Name:   "greet",
	Usage:  "Greet your terminal pet!",
	Action: greet,
}
View Source
var InitCommand = &cli.Command{
	Name: "init",
	Commands: []*cli.Command{
		{
			Name:  "pet",
			Usage: "Create a new pet",
			Arguments: []cli.Argument{
				&cli.StringArg{
					Name: "Pet name",
				},
			},
			Action: initPet,
		},
		{
			Name:  "startup",
			Usage: "Add the pet to your terminal start script",
			Flags: []cli.Flag{
				&cli.BoolFlag{
					Name:  "write",
					Usage: "Write the changes to disk instead of just printing them",
					Value: false,
				},
				&cli.StringFlag{
					Name:  "shell",
					Usage: "Specify the desired term for the configuration",
					Value: "bash",
				},
			},
			Action: initStartup,
		},
		{
			Name:  "slack",
			Usage: "Add a slack webhook for the dispatch command",
			Arguments: []cli.Argument{
				&cli.StringArg{
					Name:      "webhook",
					UsageText: "Slack webhook url to use",
				},
			},
			Action: initSlack,
		},
	},
}
View Source
var NormalGreets = [...]string{"Greeting dear user, %s here", "How you doing user? pretty chill here%t", "Why did you decide to name me %s?", "That man page is crazy  ngl%t", "Calling me right now? For real?%t", "I missed you so much!%t"}
View Source
var RpsCommand = &cli.Command{
	Name:   "rps",
	Usage:  "Rock, paper, scissors",
	Action: rps,
}
View Source
var StatCommand = &cli.Command{
	Name:   "stat",
	Usage:  "View the statistics of your pet",
	Action: stat,
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name:  "json",
			Usage: "Prints the output in json to stdout and doesn't pass it through the parser",
			Value: false,
		},
	},
}

Functions

func B

func B(s string) []byte

func I

func I(str string) int64

func RandN

func RandN(min int, max int) int

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL