Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
dm-ctl/: add --more index for query-status command to get full ta…
Browse files Browse the repository at this point in the history
…sk information(#523)  (#533)
  • Loading branch information
WangXiangUSTC authored Mar 12, 2020
1 parent 17a299c commit 392f9ff
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dm/ctl/master/query_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ type taskInfo struct {
// 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] [--more]",
Short: "query task status",
Run: queryStatusFunc,
}
cmd.Flags().BoolP("more", "", false, "whether to print the detailed task information")
return cmd
}

Expand Down Expand Up @@ -76,7 +77,13 @@ func queryStatusFunc(cmd *cobra.Command, _ []string) {
return
}

if resp.Result && taskName == "" && len(workers) == 0 {
more, err := cmd.Flags().GetBool("more")
if err != nil {
common.PrintLines("%s", errors.ErrorStack(err))
return
}

if resp.Result && taskName == "" && len(workers) == 0 && !more {
result := wrapTaskResult(resp)
common.PrettyPrintInterface(result)
} else {
Expand Down

0 comments on commit 392f9ff

Please sign in to comment.