Skip to content

Commit

Permalink
remove redundant --module flag from manage & unmanage commands (#2331)
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipRudy authored Jan 22, 2025
1 parent c52e669 commit 5ea93f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions internal/cmd/alpha/module/manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,17 @@ func newManageCMD(kymaConfig *cmdcommon.KymaConfig) *cobra.Command {
Use: "manage <module>",
Short: "Manage module.",
Long: "Use this command to manage an existing module.",

Args: cobra.ExactArgs(1),
PreRun: func(_ *cobra.Command, args []string) {
clierror.Check(cfg.validate())
},
Run: func(cmd *cobra.Command, args []string) {
cfg.module = args[0]
clierror.Check(runManage(&cfg))
},
}

cmd.Flags().StringVar(&cfg.module, "module", "", "Name of the module to manage")
cmd.Flags().StringVar(&cfg.policy, "policy", "CreateAndDelete", "Set custom resource policy. (Possible values: CreateAndDelete, Ignore)")
_ = cmd.MarkFlagRequired("module")
return cmd
}

Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/alpha/module/unmanage.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ func newUnmanageCMD(kymaConfig *cmdcommon.KymaConfig) *cobra.Command {
Use: "unmanage <module>",
Short: "Unmanage module.",
Long: "Use this command to unmanage an existing module.",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
cfg.module = args[0]
clierror.Check(runUnmanage(&cfg))
},
}

cmd.Flags().StringVar(&cfg.module, "module", "", "Name of the module to unmanage")
_ = cmd.MarkFlagRequired("module")
return cmd
}

Expand Down

0 comments on commit 5ea93f7

Please sign in to comment.