cli

package
v0.0.0-...-7cb85a9 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package cli implements a CLI handler that I shamelessly ripped off from HortBot.

Index

Constants

This section is empty.

Variables

View Source
var Default = Common{}

Default contains default env arguments.

Functions

func Run

func Run(cmd Command, args []string)

Run parses arguments then runs the given command.

Types

type Command

type Command interface {
	Name() string
	Main(context.Context, []string)
	IsDebug() bool
}

Command represents a CLI command that can be run.

type Common

type Common struct {
	Debug bool `env:"BOT2_DEBUG"`
}

Common contains args found in every command.

func (*Common) IsDebug

func (c *Common) IsDebug() bool

IsDebug returns if we're running in debug mode.

Directories

Path Synopsis
args
subcommands
bot
Package bot implements the main command for the bot.
Package bot implements the main command for the bot.
web
Package web implements the main command for the website.
Package web implements the main command for the website.

Jump to

Keyboard shortcuts

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