mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 03:42:08 +08:00
refactor: cmd update.
This commit is contained in:
parent
76abe4948f
commit
1890174565
@ -46,7 +46,7 @@ func NewPushRpcCmd() *PushRpcCmd {
|
|||||||
}
|
}
|
||||||
ret.RootCmd = NewRootCmd(program.GetProcessName(), WithConfigMap(ret.configMap))
|
ret.RootCmd = NewRootCmd(program.GetProcessName(), WithConfigMap(ret.configMap))
|
||||||
ret.ctx = context.WithValue(context.Background(), "version", config.Version)
|
ret.ctx = context.WithValue(context.Background(), "version", config.Version)
|
||||||
ret.Command.RunE = func(cmd *cobra.Command, args []string) error {
|
ret.Command.PreRunE = func(cmd *cobra.Command, args []string) error {
|
||||||
return ret.preRunE()
|
return ret.preRunE()
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
|
|||||||
@ -152,12 +152,10 @@ func defaultCmdOpts() *CmdOpts {
|
|||||||
func (r *RootCmd) getFlag(cmd *cobra.Command) (string, int, error) {
|
func (r *RootCmd) getFlag(cmd *cobra.Command) (string, int, error) {
|
||||||
configDirectory, err := cmd.Flags().GetString(FlagConf)
|
configDirectory, err := cmd.Flags().GetString(FlagConf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("err info ", err)
|
|
||||||
return "", 0, errs.Wrap(err)
|
return "", 0, errs.Wrap(err)
|
||||||
}
|
}
|
||||||
index, err := cmd.Flags().GetInt(FlagTransferIndex)
|
index, err := cmd.Flags().GetInt(FlagTransferIndex)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("err info ", err)
|
|
||||||
return "", 0, errs.Wrap(err)
|
return "", 0, errs.Wrap(err)
|
||||||
}
|
}
|
||||||
r.index = index
|
r.index = index
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user