I am attempting to replace the UsageText for a command but it doesn't seem to work:
Program:
package main
import (
"fmt"
"os"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = "Test App"
app.HelpName = "app"
app.Version = "1.2.3"
app.Commands = []cli.Command{
{
Name: "start",
Usage: "Starts the server",
UsageText: "I'm superman",
Action: func(c *cli.Context) {
fmt.Println("Start the server...")
},
},
}
app.Run(os.Args)
}
Output from go run main.go:
NAME:
Test App - A new cli application
USAGE:
app [global options] command [command options] [arguments...]
VERSION:
1.2.3
COMMANDS:
start Starts the server
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
Output from go run main.go start --help:
NAME:
app start - Starts the server
USAGE:
app start [arguments...]
Thanks for the report @nicklaw5! It looks like UsageText was ignored for commands and subcommands. This should be addressed by #593.
I have just tried to use v1 and the bug is still there
Most helpful comment
I have just tried to use v1 and the bug is still there