Made change
This commit is contained in:
40
templates.go
Normal file
40
templates.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package parser
|
||||
|
||||
import "text/template"
|
||||
|
||||
const commandHelpTemplateText = `
|
||||
App: {{.App.Name}}
|
||||
Command Usage: {{.Name}} [OPTIONS]
|
||||
|
||||
SubCommmands:
|
||||
-----------------------------------------------------------
|
||||
help : Show this help output
|
||||
{{range .SubCommands}} {{.Name | printf "%-12s" }} : {{.Description}}
|
||||
{{end}}
|
||||
|
||||
Flags:
|
||||
-----------------------------------------------------------
|
||||
-h --help : Show this help output
|
||||
{{range .Flags}}{{if .Short}}{{.Short}}{{end}} {{if .Long}}{{.Long}}{{end}} : {{.Description}}
|
||||
{{end}}
|
||||
`
|
||||
|
||||
var commandHelpTemplate = template.Must(template.New("command_help").Parse(commandHelpTemplateText))
|
||||
|
||||
const appHelpTemplateText = `
|
||||
App Usage: {{.Name}} [OPTIONS]
|
||||
|
||||
Commmands:
|
||||
-----------------------------------------------------------
|
||||
help : Show this help output
|
||||
{{range .Commands}} {{.Name | printf "%-12s" }} : {{.Description}}
|
||||
{{end}}
|
||||
|
||||
Flags:
|
||||
-----------------------------------------------------------
|
||||
-h --help : Show this help output
|
||||
{{range .Flags}}{{if .Short}}{{.Short}}{{end}}{{if .Long}} {{.Long}}{{end}} : {{.Description}}
|
||||
{{end}}
|
||||
`
|
||||
|
||||
var appHelpTemplate = template.Must(template.New("app_help").Parse(appHelpTemplateText))
|
||||
Reference in New Issue
Block a user