urfave / cli

A simple, fast, and fun package for building command line apps in Go

Home Page:https://cli.urfave.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sub-command help template shows `command [command options]` inappropriately

aryounce opened this issue · comments

The sub-command help template checks Command.VisibleFlags() instead of Command.VisibleCommands() when deciding to render the trailing command [command options] part of the USAGE section.

cli/template.go

Lines 84 to 87 in 87b48e2

USAGE:
{{if .UsageText}}{{wrap .UsageText 3}}{{else}}{{.HelpName}} {{if .VisibleFlags}}command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Description}}

This looks to be unintentional and causes the help text to imply that there are sub-commands even when none are present.