(ctx context.Context, args []string, interactive bool, dryRun bool, purge bool, force bool, all bool)
| 87 | } |
| 88 | |
| 89 | func (cli *cliItem) remove(ctx context.Context, args []string, interactive bool, dryRun bool, purge bool, force bool, all bool) error { |
| 90 | cfg := cli.cfg() |
| 91 | |
| 92 | hub, err := require.Hub(cli.cfg(), log.StandardLogger()) |
| 93 | if err != nil { |
| 94 | return err |
| 95 | } |
| 96 | |
| 97 | plan, err := cli.removePlan(hub, args, purge, force, all) |
| 98 | if err != nil { |
| 99 | return err |
| 100 | } |
| 101 | |
| 102 | showPlan := (log.StandardLogger().Level >= log.InfoLevel) |
| 103 | verbosePlan := (cfg.Cscli.Output == "raw") |
| 104 | |
| 105 | err = plan.Execute(ctx, interactive, dryRun, showPlan, verbosePlan) |
| 106 | switch { |
| 107 | case errors.Is(err, hubops.ErrUserCanceled) && err != nil: |
| 108 | // not a real error, and we'll want to print the reload message anyway |
| 109 | fmt.Fprintln(os.Stdout, err.Error()) |
| 110 | case err != nil: |
| 111 | return err |
| 112 | } |
| 113 | |
| 114 | if msg := reload.UserMessage(); msg != "" && plan.ReloadNeeded { |
| 115 | fmt.Fprintln(os.Stdout, "\n"+msg) |
| 116 | } |
| 117 | |
| 118 | return nil |
| 119 | } |
| 120 | |
| 121 | func (cli *cliItem) newRemoveCmd() *cobra.Command { |
| 122 | var ( |
no test coverage detected