From 06ee69a51f8201571e22804404ab55539f58eb86 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 29 Jun 2026 09:41:10 +0800 Subject: [PATCH] fix --- cmd/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 104c58121cf..b028e9eebfe 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -177,13 +177,14 @@ func RunMainApp(app *cli.Command, args ...string) error { ctx, cancel := installSignals() defer cancel() setCLIOnUsageError(app) - // the completion subcommands are built during app.Run, after the Walk above, so cover them via this hook - app.ConfigureShellCompletionCommand = setCLIOnUsageError + // FIXME: why it needs to set ConfigureShellCompletionCommand? What's wrong without it? + // // the completion subcommands are built during app.Run, after the Walk above, so cover them via this hook + // app.ConfigureShellCompletionCommand = setCLIOnUsageError err := app.Run(ctx, args) if err == nil { return nil } - if ue := (usageErr{}); errors.As(err, &ue) { + if _, ok := errors.AsType[usageErr](err); ok { cli.OsExiter(1) // cliOnUsageError already reported it return err }