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
{{ message }}
Repository navigation
Commit a6313e2
Browse filesBrowse the repository at this point in the historyBrowse files
Fail early when custom templates are used with urfave_cli_no_template
With urfave_cli_no_template tag, custom templates are not supported,
but using them results in a working binary which just prints an error
instead of help. Make such misuse fail as early as possible:
- with the tag, make RootCommandHelpTemplate, CommandHelpTemplate,
SubcommandHelpTemplate and FishCompletionTemplate constants, so an
attempt to modify them results in a compile error;
- with the tag, return an error from Run if CustomRootCommandHelpTemplate
or CustomHelpTemplate is set for any command.
The only remaining case is calling DefaultPrintHelpCustom with a custom
template, which still prints an error instead of help.
To keep the template text in one place, the default values are now
defined as unexported constants, which the exported variables (or, with
the tag, constants) are initialized from.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
0 commit comments