-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] add bs status copyset #2520
Conversation
cicheck |
268b859
to
ea11ce5
Compare
} | ||
|
||
func (cCmd *CopysetCommand) Init(cmd *cobra.Command, args []string) error { | ||
config.AddBsFilterOptionFlag(cCmd.Cmd) |
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.
add flag in AddFlags
?
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.
add flag in
AddFlags
?
This is for the called command, not a parameter of the command.
fmt.Sprintf("--%s", config.CURVEBS_LOGIC_POOL_ID), strings.Join(poolIds, ","), | ||
}) | ||
|
||
checkRes, err := checkcopyset.GatCopysetsStaus(cCmd.Cmd) |
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.
GatCopysetsStaus
spell error
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.
GatCopysetsStaus
spell error
fix
@@ -167,6 +168,34 @@ func AlignFlagsValue(caller *cobra.Command, callee *cobra.Command, flagNames []s | |||
} | |||
} | |||
|
|||
type stringSlice struct { | |||
value []string | |||
change bool |
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.
seem useless?
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.
seem useless?
This is to make the flag names of the calling command and the called command consistent, but one is prepared when the string slice and the other is string. There is a problem with the design of pflag, which can be avoided by this method.
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.
func (s *stringSliceValue) Set(val string) error {
v, err := readAsCSV(val)
if err != nil {
return err
}
if !s.changed {
*s.value = v
} else {
*s.value = append(*s.value, v...)
}
s.changed = true
return nil
}
Here is an additional write.
ea11ce5
to
2b3cef3
Compare
cicheck |
2b3cef3
to
e6cd8d8
Compare
cicheck |
Signed-off-by: Cyber-SiKu <Cyber-SiKu@outlook.com>
e6cd8d8
to
8c70d6e
Compare
What problem does this PR solve?
Issue Number: #xxx
Problem Summary:
What is changed and how it works?
What's Changed:
How it Works:
Side effects(Breaking backward compatibility? Performance regression?):
Check List