mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-04 22:58:38 +00:00
fix
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user