rpaste/modules/setting/usage.go

24 lines
566 B
Go
Raw Normal View History

2021-12-21 01:06:08 +00:00
package setting
import (
2021-12-24 09:01:22 +00:00
"fmt"
"github.com/urfave/cli/v2"
2021-12-21 01:06:08 +00:00
)
var (
2021-12-24 09:01:22 +00:00
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" +
2021-12-28 04:27:10 +00:00
"This command can take a file or standard in as input\n\n" +
2021-12-24 09:01:22 +00:00
"Options:\n" +
"{{range .VisibleFlags}}{{.}}\n" +
"{{end}}"
2021-12-21 01:06:08 +00:00
)
func VersionTemplate(c *cli.Context) {
2021-12-24 09:01:22 +00:00
fmt.Printf("%s%s%s version %s\n\n%s\n", colorGreen, c.App.Name, colorReset, c.App.Version, c.App.UsageText)
2021-12-21 01:06:08 +00:00
}