From 8b46886de806f530a31802bd135a808ff33d5761 Mon Sep 17 00:00:00 2001 From: Kaushal Subedi Date: Sat, 24 Oct 2015 23:37:21 -0600 Subject: [PATCH] added flag to have a custom text on the USAGE section of help --- command.go | 2 ++ help.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/command.go b/command.go index fac754d..500f235 100644 --- a/command.go +++ b/command.go @@ -16,6 +16,8 @@ type Command struct { Aliases []string // A short description of the usage of this command Usage string + // Custom text to show on USAGE section of help + UsageText string // A longer explanation of how the command works Description string // A short description of the arguments of this command diff --git a/help.go b/help.go index a246f63..ff7c4cb 100644 --- a/help.go +++ b/help.go @@ -15,7 +15,7 @@ var AppHelpTemplate = `NAME: {{.Name}} - {{.Usage}} USAGE: - {{.HelpName}} {{if .Flags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}} + {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .Flags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}} {{if .Version}} VERSION: {{.Version}}