You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -141,33 +161,60 @@ We collect anonymous usage data to help improve cagent. To disable:
141
161
rootCmd.SetOut(stdout)
142
162
rootCmd.SetErr(stderr)
143
163
144
-
iferr:=rootCmd.ExecuteContext(ctx); err!=nil {
145
-
ifctx.Err() !=nil {
146
-
returnctx.Err()
147
-
} elseifenvErr, ok:= errors.AsType[*environment.RequiredEnvError](err); ok {
148
-
fmt.Fprintln(stderr, "The following environment variables must be set:")
149
-
for_, v:=rangeenvErr.Missing {
150
-
fmt.Fprintf(stderr, " - %s\n", v)
151
-
}
152
-
fmt.Fprintln(stderr, "\nEither:\n - Set those environment variables before running cagent\n - Run cagent with --env-from-file\n - Store those secrets using one of the built-in environment variable providers.")
153
-
} elseif_, ok:= errors.AsType[RuntimeError](err); ok {
154
-
// Runtime errors have already been printed by the command itself
155
-
// Don't print them again or show usage
156
-
} else {
157
-
// Command line usage errors - show the error and usage
} elseifenvErr, ok:= errors.AsType[*environment.RequiredEnvError](err); ok {
198
+
fmt.Fprintln(stderr, "The following environment variables must be set:")
199
+
for_, v:=rangeenvErr.Missing {
200
+
fmt.Fprintf(stderr, " - %s\n", v)
201
+
}
202
+
fmt.Fprintln(stderr, "\nEither:\n - Set those environment variables before running cagent\n - Run cagent with --env-from-file\n - Store those secrets using one of the built-in environment variable providers.")
203
+
} elseif_, ok:= errors.AsType[RuntimeError](err); ok {
204
+
// Runtime errors have already been printed by the command itself
205
+
// Don't print them again or show usage
206
+
} else {
207
+
// Command line usage errors - show the error and usage
0 commit comments