dev: silence help on some commands usage on error (#4542)
This commit is contained in:
parent
eaafdf3623
commit
1b6f0069d4
@ -25,11 +25,12 @@ func newCustomCommand(logger logutils.Log) *customCommand {
|
|||||||
c := &customCommand{log: logger}
|
c := &customCommand{log: logger}
|
||||||
|
|
||||||
customCmd := &cobra.Command{
|
customCmd := &cobra.Command{
|
||||||
Use: "custom",
|
Use: "custom",
|
||||||
Short: "Build a version of golangci-lint with custom linters",
|
Short: "Build a version of golangci-lint with custom linters",
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
PreRunE: c.preRunE,
|
PreRunE: c.preRunE,
|
||||||
RunE: c.runE,
|
RunE: c.runE,
|
||||||
|
SilenceUsage: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
c.cmd = customCmd
|
c.cmd = customCmd
|
||||||
|
@ -44,6 +44,7 @@ func newLintersCommand(logger logutils.Log) *lintersCommand {
|
|||||||
ValidArgsFunction: cobra.NoFileCompletions,
|
ValidArgsFunction: cobra.NoFileCompletions,
|
||||||
RunE: c.execute,
|
RunE: c.execute,
|
||||||
PreRunE: c.preRunE,
|
PreRunE: c.preRunE,
|
||||||
|
SilenceUsage: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
fs := lintersCmd.Flags()
|
fs := lintersCmd.Flags()
|
||||||
|
@ -118,6 +118,7 @@ func newRunCommand(logger logutils.Log, info BuildInfo) *runCommand {
|
|||||||
PostRun: c.postRun,
|
PostRun: c.postRun,
|
||||||
PersistentPreRunE: c.persistentPreRunE,
|
PersistentPreRunE: c.persistentPreRunE,
|
||||||
PersistentPostRunE: c.persistentPostRunE,
|
PersistentPostRunE: c.persistentPostRunE,
|
||||||
|
SilenceUsage: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
runCmd.SetOut(logutils.StdOut) // use custom output to properly color it in Windows terminals
|
runCmd.SetOut(logutils.StdOut) // use custom output to properly color it in Windows terminals
|
||||||
|
Loading…
x
Reference in New Issue
Block a user