rpaste/modules/setting/usage.go
2021-12-24 02:01:22 -07:00

23 lines
503 B
Go

package setting
import (
"fmt"
"github.com/urfave/cli/v2"
)
var (
colorGreen = "\033[01;32m"
colorReset = "\033[0m"
HelpTemplate = "\033[01;32m{{.Name}}\033[0m: {{.Usage}}\n\n" +
"Usage: {{.Name}} [options] [filepath]\n" +
" command | {{.Name}} [options]\n\n" +
"Options:\n" +
"{{range .VisibleFlags}}{{.}}\n" +
"{{end}}"
)
func VersionTemplate(c *cli.Context) {
fmt.Printf("%s%s%s version %s\n\n%s\n", colorGreen, c.App.Name, colorReset, c.App.Version, c.App.UsageText)
}