Silence usage message on runtime error

This commit is contained in:
Laurence Withers 2023-07-07 11:10:31 +01:00
parent d2cf57dcd9
commit 67f81d2728
1 changed files with 4 additions and 0 deletions

View File

@ -77,6 +77,10 @@ func init() {
}
func run(c *cobra.Command, args []string) error {
// if we got past argument passing, then returned errors are runtime
// things (like file not found) that shouldn't trigger a usage message.
c.SilenceUsage = true
display = NewDisplay(noColour)
if len(searchRegexp) == 0 && len(searchFixed) == 0 {