Merge pull request #2178 from carlory/remove-DisableFlagsInUseLine
enable addition of [flags] to the usage line
This commit is contained in:
commit
0bc4742a2b
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue