Skip to content

Commit

Permalink
remove the default completion command generated by cobra
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoxinyu committed Nov 29, 2021
1 parent f32d10b commit c67ff9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dm/dm/ctl/ctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func NewRootCmd() *cobra.Command {
Short: "DM control",
SilenceUsage: true,
SilenceErrors: true,
CompletionOptions: cobra.CompletionOptions{
DisableDefaultCmd: true,
},
}
// --worker worker1 -w worker2 --worker=worker3,worker4 -w=worker5,worker6
cmd.PersistentFlags().StringSliceVarP(&commandMasterFlags.workers, "source", "s", []string{}, "MySQL Source ID.")
Expand Down
2 changes: 1 addition & 1 deletion dm/tests/dmctl_command/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cur=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
source $cur/../_utils/test_prepare
WORK_DIR=$TEST_DIR/$TEST_NAME

help_cnt=44
help_cnt=45

function run() {
# check dmctl output with help flag
Expand Down
3 changes: 3 additions & 0 deletions pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ func NewCmd() *cobra.Command {
Use: "cdc",
Short: "CDC",
Long: `Change Data Capture`,
CompletionOptions: cobra.CompletionOptions{
DisableDefaultCmd: true,
},
}
}

Expand Down

0 comments on commit c67ff9d

Please sign in to comment.