feat: add yaml config support
This commit is contained in:
@ -10,8 +10,15 @@ import (
|
||||
"ultone/internal/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
cliCommand = &cobra.Command{
|
||||
var ()
|
||||
|
||||
func initCli() *cobra.Command {
|
||||
var (
|
||||
svc string
|
||||
cliClient *rpc.Client
|
||||
)
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "cli",
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
log.Debug(cmd.Context(), "[cmd.cli] svc address: %s", svc)
|
||||
@ -34,13 +41,8 @@ var (
|
||||
},
|
||||
}
|
||||
|
||||
svc string
|
||||
cliClient *rpc.Client
|
||||
)
|
||||
|
||||
func initCli() {
|
||||
cliCommand.PersistentFlags().StringVar(&svc, "svc", opt.RpcAddress, "server unix listen address")
|
||||
cliCommand.AddCommand(&cobra.Command{
|
||||
cmd.PersistentFlags().StringVar(&svc, "svc", opt.RpcAddress, "server unix listen address")
|
||||
cmd.AddCommand(&cobra.Command{
|
||||
Use: "set",
|
||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||
log.Debug(cmd.Context(), "[cli.set] all args: %v", args)
|
||||
@ -73,4 +75,6 @@ func initCli() {
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
Reference in New Issue
Block a user