-
Notifications
You must be signed in to change notification settings - Fork 188
dmctl: fix dmctl command to improve its usability #1750
dmctl: fix dmctl command to improve its usability #1750
Conversation
|
||
func loop() error { | ||
l, err := readline.NewEx(&readline.Config{ | ||
Prompt: "\033[31m»\033[0m ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will review later
@@ -15,9 +15,11 @@ function dmctl_unwrap_schema() { | |||
function dmctl_wrong_addrs() { | |||
run_dm_ctl $WORK_DIR "https://127.0.0.1:1234,127.0.0.2:1234" \ | |||
"list-member" \ | |||
"can't connect to https:\/\/127.0.0.1:1234,127.0.0.2:1234" 1 | |||
"can't connect to https:\/\/127.0.0.1:1234,127.0.0.2:1234" 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now print error message twice 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Remember to update docs after merge.
return Init(cfg) | ||
} | ||
common.DefineConfigFlagSet(rootCmd.PersistentFlags()) | ||
rootCmd.SetArgs(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SetArgs sets arguments for the command. It is set to os.Args[1:] by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7fb0f2c
|
In response to a cherrypick label: new pull request created: #1771. |
What problem does this PR solve?
Previous dmctl has to put
--master-addr
in the front. What's more, we hack many usage which is not standard usage of cobra commands.What is changed and how it works?
--master-addr
can be put any where.--decrypt/encrypt
as hidden. Addencrypt/decrypt
commands.Check List
Tests
Related changes