(w *world.World)
| 44 | } |
| 45 | |
| 46 | func rootPreRun(w *world.World) func(cmd *cobra.Command, args []string) error { |
| 47 | return func(cmd *cobra.Command, _ []string) error { |
| 48 | w.Logger = slog.New(slog.NewTextHandler(cmd.ErrOrStderr(), nil)) |
| 49 | |
| 50 | if w.CustomHeaderError != nil { |
| 51 | return w.CustomHeaderError |
| 52 | } |
| 53 | |
| 54 | // Validate all flags and environment variables |
| 55 | if err := validation.ValidateFlags(w); err != nil { |
| 56 | return errors.Wrapf(err, "failed to validate flags") |
| 57 | } |
| 58 | |
| 59 | return nil |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // newClientFromWorld creates a client using the authentication configured in World. |
| 64 | func newClientFromWorld(w *world.World) (*client, error) { |
no test coverage detected