mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 03:26:57 +08:00
script
This commit is contained in:
parent
946fba17ef
commit
955e776d3f
@ -27,18 +27,6 @@ func NewRootCmd() (rootCmd *RootCmd) {
|
|||||||
return rootCmd
|
return rootCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RootCmd) AddRunE(f func(cmd RootCmd) error) {
|
|
||||||
r.Command.RunE = func(cmd *cobra.Command, args []string) error {
|
|
||||||
return f(*r)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *RootCmd) AddRpc(f func(port, prometheusPort int) error) {
|
|
||||||
r.Command.RunE = func(cmd *cobra.Command, args []string) error {
|
|
||||||
return f(r.getPortFlag(cmd), r.getPrometheusPortFlag(cmd))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *RootCmd) addConfFlag() {
|
func (r *RootCmd) addConfFlag() {
|
||||||
r.Command.Flags().StringP(constant.FlagConf, "c", "", "Path to config file folder")
|
r.Command.Flags().StringP(constant.FlagConf, "c", "", "Path to config file folder")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user