Merge remote-tracking branch 'origin/3.6.1-code-conventions' into 3.6.1-code-conventions

pull/2148/head
skiffer-git 1 year ago
commit 777fa8c2cc

@ -29,6 +29,8 @@ func main() {
getCmd.AddCommand(seqCmd.GetSeqCmd(), msgCmd.GetMsgCmd())
getCmd.AddSuperGroupIDFlag()
getCmd.AddUserIDFlag()
getCmd.AddConfigDirFlag()
getCmd.AddIndexFlag()
getCmd.AddBeginSeqFlag()
getCmd.AddLimitFlag()
// openIM get seq --userID=xxx
@ -39,6 +41,8 @@ func main() {
fixCmd.AddCommand(seqCmd.FixSeqCmd())
fixCmd.AddSuperGroupIDFlag()
fixCmd.AddUserIDFlag()
fixCmd.AddConfigDirFlag()
fixCmd.AddIndexFlag()
fixCmd.AddFixAllFlag()
// openIM fix seq --userID=xxx
// openIM fix seq --superGroupID=xxx
@ -47,6 +51,8 @@ func main() {
clearCmd.AddCommand(msgCmd.ClearMsgCmd())
clearCmd.AddSuperGroupIDFlag()
clearCmd.AddUserIDFlag()
clearCmd.AddConfigDirFlag()
clearCmd.AddIndexFlag()
clearCmd.AddClearAllFlag()
clearCmd.AddBeginSeqFlag()
clearCmd.AddLimitFlag()

@ -30,6 +30,14 @@ type MsgUtilsCmd struct {
func (m *MsgUtilsCmd) AddUserIDFlag() {
m.Command.PersistentFlags().StringP("userID", "u", "", "openIM userID")
}
func (m *MsgUtilsCmd) AddIndexFlag() {
m.Command.PersistentFlags().IntP(FlagTransferIndex, "i", 0, "process startup sequence number")
}
func (m *MsgUtilsCmd) AddConfigDirFlag() {
m.Command.PersistentFlags().StringP(FlagConf, "c", "", "path of config directory")
}
func (m *MsgUtilsCmd) getUserIDFlag(cmdLines *cobra.Command) string {
userID, _ := cmdLines.Flags().GetString("userID")
@ -46,7 +54,7 @@ func (m *MsgUtilsCmd) AddFixAllFlag() {
} */
func (m *MsgUtilsCmd) AddClearAllFlag() {
m.Command.PersistentFlags().BoolP("clearAll", "c", false, "openIM clear all seqs")
m.Command.PersistentFlags().BoolP("clearAll", "cl", false, "openIM clear all seqs")
}
/* func (m *MsgUtilsCmd) getClearAllFlag(cmdLines *cobra.Command) bool {

Loading…
Cancel
Save