You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On cmd.go the setupHelp() function has the following logic to determine if the help flags (-h and --help) should be automatically added:
if (len(cmd.optentries) > 0 || len(cmd.commands) > 0) && cmd.shortopt["-h"] == nil {
cmd.Bool("help", "h", false, "Show this help message.")
}
Note that it checks for the existence of any flags (len(cmd.optentries) > 0) or commands (len(cmd.commands) > 0). However, it does not account for the existence of operands (cmd.operands), so when a command has no flags or commands, but has operands, the automatic help flag is not generated.
Note that this change might cause impact on some tests.
The text was updated successfully, but these errors were encountered:
On
cmd.go
thesetupHelp()
function has the following logic to determine if the help flags (-h
and--help
) should be automatically added:Note that it checks for the existence of any flags (
len(cmd.optentries) > 0
) or commands (len(cmd.commands) > 0
). However, it does not account for the existence of operands (cmd.operands
), so when a command has no flags or commands, but has operands, the automatic help flag is not generated.Note that this change might cause impact on some tests.
The text was updated successfully, but these errors were encountered: