Fix minor UsageError bug

This commit is contained in:
rwxrob 2022-02-24 21:14:37 -05:00
parent cf1e15abff
commit 7508d7bf9b
No known key found for this signature in database
GPG Key ID: 2B9111F33082AE77

3
cmd.go
View File

@ -113,8 +113,9 @@ func (x *Cmd) Run() {
Exit() Exit()
} }
// UsageError returns an error with a single-line usage string.
func (x *Cmd) UsageError() error { func (x *Cmd) UsageError() error {
return fmt.Sprintf("usage: %v %v\n", x.Name, x.Usage) return fmt.Errorf("usage: %v %v\n", x.Name, x.Usage)
} }
// Add creates a new Cmd and sets the name and aliases and adds to // Add creates a new Cmd and sets the name and aliases and adds to