Merge pull request #2178 from carlory/remove-DisableFlagsInUseLine

enable addition of [flags] to the usage line
This commit is contained in:
karmada-bot 2022-07-15 15:40:39 +08:00 committed by GitHub
commit 0bc4742a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 15 deletions

View File

@ -33,11 +33,10 @@ func NewCmdDescribe(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Co
}
cmd := &cobra.Command{
Use: "describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME) (-C CLUSTER)",
DisableFlagsInUseLine: true,
Short: "Show details of a specific resource or group of resources in a cluster",
SilenceUsage: true,
Example: describeExample(parentCommand),
Use: "describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME) (-C CLUSTER)",
Short: "Show details of a specific resource or group of resources in a cluster",
SilenceUsage: true,
Example: describeExample(parentCommand),
RunE: func(cmd *cobra.Command, args []string) error {
if err := o.Complete(karmadaConfig, args); err != nil {
return err

View File

@ -29,11 +29,10 @@ func NewCmdExec(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Comman
}
cmd := &cobra.Command{
Use: "exec (POD | TYPE/NAME) [-c CONTAINER] [flags] (-C CLUSTER) -- COMMAND [args...]",
DisableFlagsInUseLine: true,
Short: "Execute a command in a container in a cluster",
Long: "Execute a command in a container in a cluster",
Example: execExample(parentCommand),
Use: "exec (POD | TYPE/NAME) [-c CONTAINER] [flags] (-C CLUSTER) -- COMMAND [args...]",
Short: "Execute a command in a container in a cluster",
Long: "Execute a command in a container in a cluster",
Example: execExample(parentCommand),
RunE: func(cmd *cobra.Command, args []string) error {
argsLenAtDash := cmd.ArgsLenAtDash()
if err := o.Complete(karmadaConfig, cmd, args, argsLenAtDash); err != nil {

View File

@ -66,11 +66,10 @@ func NewCmdGet(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Command
ioStreams := genericclioptions.IOStreams{In: getIn, Out: getOut, ErrOut: getErr}
o := NewCommandGetOptions("karmadactl", ioStreams)
cmd := &cobra.Command{
Use: "get [NAME | -l label | -n namespace] [flags]",
DisableFlagsInUseLine: true,
Short: getShort,
SilenceUsage: true,
Example: getExample(parentCommand),
Use: "get [NAME | -l label | -n namespace] [flags]",
Short: getShort,
SilenceUsage: true,
Example: getExample(parentCommand),
RunE: func(cmd *cobra.Command, args []string) error {
if err := o.Complete(karmadaConfig); err != nil {
return err