Skip to content

Commit

Permalink
*: refine dmctl output for DM-master, task-name and config-file (
Browse files Browse the repository at this point in the history
  • Loading branch information
csuzhangxc authored and IANTHEREAL committed Sep 18, 2019
1 parent bf908b6 commit 4c39a6b
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion dm/ctl/master/check_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
// NewCheckTaskCmd creates a CheckTask command
func NewCheckTaskCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "check-task <config_file>",
Use: "check-task <config-file>",
Short: "check a task with config file",
Run: checkTaskFunc,
}
Expand Down
2 changes: 1 addition & 1 deletion dm/ctl/master/pause_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
// NewPauseTaskCmd creates a PauseTask command
func NewPauseTaskCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "pause-task [-w worker ...] <task_name>",
Use: "pause-task [-w worker ...] <task-name>",
Short: "pause a running task with name",
Run: pauseTaskFunc,
}
Expand Down
2 changes: 1 addition & 1 deletion dm/ctl/master/query_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// NewQueryErrorCmd creates a QueryError command
func NewQueryErrorCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "query-error [-w worker ...] [task_name]",
Use: "query-error [-w worker ...] [task-name]",
Short: "query task's error",
Run: queryErrorFunc,
}
Expand Down
2 changes: 1 addition & 1 deletion dm/ctl/master/query_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// NewQueryStatusCmd creates a QueryStatus command
func NewQueryStatusCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "query-status [-w worker ...] [task_name]",
Use: "query-status [-w worker ...] [task-name]",
Short: "query task's status",
Run: queryStatusFunc,
}
Expand Down
2 changes: 1 addition & 1 deletion dm/ctl/master/resume_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
// NewResumeTaskCmd creates a ResumeTask command
func NewResumeTaskCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "resume-task [-w worker ...] <task_name>",
Use: "resume-task [-w worker ...] <task-name>",
Short: "resume a paused task with name",
Run: resumeTaskFunc,
}
Expand Down
2 changes: 1 addition & 1 deletion dm/ctl/master/show_ddl_locks.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// NewShowDDLLocksCmd creates a ShowDDlLocks command
func NewShowDDLLocksCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "show-ddl-locks [-w worker ...] [task_name]",
Use: "show-ddl-locks [-w worker ...] [task-name]",
Short: "show un-resolved DDL locks",
Run: showDDLLocksFunc,
}
Expand Down
4 changes: 2 additions & 2 deletions dm/ctl/master/sql_inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
// NewSQLInjectCmd creates a SQLInject command
func NewSQLInjectCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "sql-inject <-w worker> <task_name> <sql1;sql2;>",
Use: "sql-inject <-w worker> <task-name> <sql1;sql2;>",
Short: "sql-inject injects (limited) sqls into syncer as binlog event",
Run: sqlInjectFunc,
}
Expand All @@ -54,7 +54,7 @@ func sqlInjectFunc(cmd *cobra.Command, _ []string) {

taskName := cmd.Flags().Arg(0)
if strings.TrimSpace(taskName) == "" {
common.PrintLines("task_name is empty")
common.PrintLines("task-name is empty")
return
}

Expand Down
2 changes: 1 addition & 1 deletion dm/ctl/master/start_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
// NewStartTaskCmd creates a StartTask command
func NewStartTaskCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "start-task [-w worker ...] <config_file>",
Use: "start-task [-w worker ...] <config-file>",
Short: "start a task with config file",
Run: startTaskFunc,
}
Expand Down
2 changes: 1 addition & 1 deletion dm/ctl/master/stop_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
// NewStopTaskCmd creates a StopTask command
func NewStopTaskCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "stop-task [-w worker ...] <task_name>",
Use: "stop-task [-w worker ...] <task-name>",
Short: "stop a task with name",
Run: stopTaskFunc,
}
Expand Down
4 changes: 2 additions & 2 deletions dm/ctl/master/update_masterconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
// NewUpdateMasterConfigCmd creates a UpdateMasterConfig command
func NewUpdateMasterConfigCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "update-master-config <config_file>",
Short: "update configure of dm-master",
Use: "update-master-config <config-file>",
Short: "update configure of DM-master",
Run: updateMasterConfigFunc,
}
return cmd
Expand Down
2 changes: 1 addition & 1 deletion dm/ctl/master/update_relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// NewUpdateRelayCmd creates a UpdateRelay command
func NewUpdateRelayCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "update-relay [-w worker ...] <config_file>",
Use: "update-relay [-w worker ...] <config-file>",
Short: "update dm-worker's relay unit configure",
Run: updateRelayFunc,
}
Expand Down
2 changes: 1 addition & 1 deletion dm/ctl/master/update_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
// NewUpdateTaskCmd creates a UpdateTask command
func NewUpdateTaskCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "update-task [-w worker ...] <config_file>",
Use: "update-task [-w worker ...] <config-file>",
Short: "update a task's config for routes, filters, column-mappings, black-white-list",
Run: updateTaskFunc,
}
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_advance/check_list/query_error.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function query_error_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"query-error wrong_args_count more_than_one" \
"query-error \[-w worker ...\] \[task_name\]" 1
"query-error \[-w worker ...\] \[task-name\]" 1
}

function query_error_while_master_down() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_basic/check_list/check_task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function check_task_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"check-task" \
"check-task <config_file> \[flags\]" 1
"check-task <config-file> \[flags\]" 1
}

function check_task_wrong_config_file() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_basic/check_list/pause_task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function pause_task_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"pause-task" \
"pause-task \[-w worker ...\] <task_name> \[flags\]" 1
"pause-task \[-w worker ...\] <task-name> \[flags\]" 1
}

function pause_task_while_master_down() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_basic/check_list/query_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function query_status_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"query-status wrong_args_count more_than_one" \
"query-status \[-w worker ...\] \[task_name\]" 1
"query-status \[-w worker ...\] \[task-name\]" 1
}

function query_status_wrong_params() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_basic/check_list/resume_task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function resume_task_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"resume-task" \
"resume-task \[-w worker ...\] <task_name> \[flags\]" 1
"resume-task \[-w worker ...\] <task-name> \[flags\]" 1
}

function resume_task_while_master_down() {
Expand Down
6 changes: 3 additions & 3 deletions tests/dmctl_basic/check_list/show_ddl_locks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
function show_ddl_locks_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"show-ddl-locks a b" \
"show-ddl-locks \[-w worker ...\] \[task_name\] \[flags\]" 1
"show-ddl-locks \[-w worker ...\] \[task-name\] \[flags\]" 1
}

function show_ddl_locks_while_master_down() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"show-ddl-locks task_name -w 127.0.0.1:8262" \
"can not show DDL locks for task task_name and workers \[127.0.0.1:8262\]" 1
"show-ddl-locks task-name -w 127.0.0.1:8262" \
"can not show DDL locks for task task-name and workers \[127.0.0.1:8262\]" 1
}

function show_ddl_locks_no_locks() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_basic/check_list/start_task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function start_task_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"start-task" \
"start-task \[-w worker ...\] <config_file> \[flags\]" 1
"start-task \[-w worker ...\] <config-file> \[flags\]" 1
}

function start_task_wrong_config_file() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_basic/check_list/stop_task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function stop_task_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"stop-task" \
"stop-task \[-w worker ...\] <task_name> \[flags\]" 1
"stop-task \[-w worker ...\] <task-name> \[flags\]" 1
}

function stop_task_while_master_down() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_basic/check_list/update_master_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function update_master_config_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"update-master-config" \
"update-master-config <config_file> \[flags\]" 1
"update-master-config <config-file> \[flags\]" 1
}

function update_master_config_wrong_config_file() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_basic/check_list/update_relay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function update_relay_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"update-relay" \
"update-relay \[-w worker ...\] <config_file> \[flags\]" 1
"update-relay \[-w worker ...\] <config-file> \[flags\]" 1
}

function update_relay_wrong_config_file() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_basic/check_list/update_task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function update_task_wrong_arg() {
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"update-task" \
"update-task \[-w worker ...\] <config_file> \[flags\]" 1
"update-task \[-w worker ...\] <config-file> \[flags\]" 1
}

function update_task_wrong_config_file() {
Expand Down

0 comments on commit 4c39a6b

Please sign in to comment.