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{
|
cmd := &cobra.Command{
|
||||||
Use: "describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME) (-C CLUSTER)",
|
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",
|
||||||
Short: "Show details of a specific resource or group of resources in a cluster",
|
SilenceUsage: true,
|
||||||
SilenceUsage: true,
|
Example: describeExample(parentCommand),
|
||||||
Example: describeExample(parentCommand),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
if err := o.Complete(karmadaConfig, args); err != nil {
|
if err := o.Complete(karmadaConfig, args); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -29,11 +29,10 @@ func NewCmdExec(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Comman
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "exec (POD | TYPE/NAME) [-c CONTAINER] [flags] (-C CLUSTER) -- COMMAND [args...]",
|
Use: "exec (POD | TYPE/NAME) [-c CONTAINER] [flags] (-C CLUSTER) -- COMMAND [args...]",
|
||||||
DisableFlagsInUseLine: true,
|
Short: "Execute a command in a container in a cluster",
|
||||||
Short: "Execute a command in a container in a cluster",
|
Long: "Execute a command in a container in a cluster",
|
||||||
Long: "Execute a command in a container in a cluster",
|
Example: execExample(parentCommand),
|
||||||
Example: execExample(parentCommand),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
argsLenAtDash := cmd.ArgsLenAtDash()
|
argsLenAtDash := cmd.ArgsLenAtDash()
|
||||||
if err := o.Complete(karmadaConfig, cmd, args, argsLenAtDash); err != nil {
|
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}
|
ioStreams := genericclioptions.IOStreams{In: getIn, Out: getOut, ErrOut: getErr}
|
||||||
o := NewCommandGetOptions("karmadactl", ioStreams)
|
o := NewCommandGetOptions("karmadactl", ioStreams)
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "get [NAME | -l label | -n namespace] [flags]",
|
Use: "get [NAME | -l label | -n namespace] [flags]",
|
||||||
DisableFlagsInUseLine: true,
|
Short: getShort,
|
||||||
Short: getShort,
|
SilenceUsage: true,
|
||||||
SilenceUsage: true,
|
Example: getExample(parentCommand),
|
||||||
Example: getExample(parentCommand),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
if err := o.Complete(karmadaConfig); err != nil {
|
if err := o.Complete(karmadaConfig); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue