Skip to content

Commit 7fab067

Browse files
committed
UsageErrorPrefix -> ShowUsageOnError
1 parent 21892d7 commit 7fab067

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cli/clibase/cmd.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ func Chain(ms ...MiddlewareFunc) MiddlewareFunc {
562562
return chain(reversed...)
563563
}
564564

565-
func UsageErrorPrefix(next HandlerFunc) HandlerFunc {
565+
func ShowUsageOnError(next HandlerFunc) HandlerFunc {
566566
return func(i *Invocation) error {
567567
err := next(i)
568568
if err != nil {
@@ -584,8 +584,8 @@ func RequireRangeArgs(start, end int) MiddlewareFunc {
584584
panic("start must be >= 0")
585585
}
586586
return func(next HandlerFunc) HandlerFunc {
587-
// UsageErrorPrefix will add the command usage before the error message.
588-
return UsageErrorPrefix(func(i *Invocation) error {
587+
// ShowUsageOnError will add the command usage before the error message.
588+
return ShowUsageOnError(func(i *Invocation) error {
589589
got := len(i.Args)
590590
switch {
591591
case start == end && got != start:

0 commit comments

Comments
 (0)