mirror of
https://github.com/spf13/cobra
synced 2025-04-27 17:17:20 +00:00
[update] Several changes that were reviewed
Fix some grammar misses and use `cmd` for subcommands.
This commit is contained in:
parent
da3c9eeebd
commit
fabc43c5eb
2 changed files with 3 additions and 3 deletions
|
@ -1099,7 +1099,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
|
|||
// If root command has SilenceErrors flagged,
|
||||
// all subcommands should respect it
|
||||
if !cmd.SilenceErrors && !c.SilenceErrors {
|
||||
c.PrintErrln(c.ErrPrefix(), err.Error())
|
||||
c.PrintErrln(cmd.ErrPrefix(), err.Error())
|
||||
}
|
||||
|
||||
// If root command has SilenceUsage flagged,
|
||||
|
|
|
@ -598,8 +598,8 @@ the version template. The template can be customized using the
|
|||
|
||||
## Error Message Prefix
|
||||
|
||||
Cobra prints an error message when being returned a non-nil error value.
|
||||
The default error message is `Error: error contents`.
|
||||
Cobra prints an error message when receiving a non-nil error value.
|
||||
The default error message is `Error: <error contents>`.
|
||||
The Prefix, `Error:` can be customized using the `cmd.SetErrPrefix(s string)` function.
|
||||
|
||||
## PreRun and PostRun Hooks
|
||||
|
|
Loading…
Add table
Reference in a new issue