mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-07 14:32:13 +08:00
refactor: cmd update.
This commit is contained in:
parent
9857ea2d57
commit
a447748c4d
@ -66,14 +66,13 @@ func WithConfigMap(configMap map[string]any) func(*CmdOpts) {
|
|||||||
func NewRootCmd(processName string, opts ...func(*CmdOpts)) *RootCmd {
|
func NewRootCmd(processName string, opts ...func(*CmdOpts)) *RootCmd {
|
||||||
rootCmd := &RootCmd{processName: processName}
|
rootCmd := &RootCmd{processName: processName}
|
||||||
cmd := cobra.Command{
|
cmd := cobra.Command{
|
||||||
Use: "Start openIM application",
|
Use: "Start openIM application",
|
||||||
Short: fmt.Sprintf(`Start %s `, processName),
|
Long: fmt.Sprintf(`Start %s `, processName),
|
||||||
Long: fmt.Sprintf(`Start %s `, processName),
|
|
||||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||||
return rootCmd.persistentPreRun(cmd, opts...)
|
return rootCmd.persistentPreRun(cmd, opts...)
|
||||||
},
|
},
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
SilenceErrors: true,
|
SilenceErrors: false,
|
||||||
}
|
}
|
||||||
cmd.Flags().StringP(FlagConf, "c", "", "path of config directory")
|
cmd.Flags().StringP(FlagConf, "c", "", "path of config directory")
|
||||||
cmd.Flags().IntP(FlagTransferIndex, "i", 0, "process startup sequence number")
|
cmd.Flags().IntP(FlagTransferIndex, "i", 0, "process startup sequence number")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user