-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add subcommands #912
base: v4
Are you sure you want to change the base?
add subcommands #912
Conversation
或许你可以使用环境变量来实现。
执行:
|
感觉这样搞,命令比命还长🤣,主要是配置本身比较多,线上环境基本上设置了密码这些,不是两三个参数就能开始同步的,确实不如设置通用配置文件替换环境变量 @suxb201 话说之前viper自动根据结构体读取环境变量是因为啥删掉了,改成手动解析来着? |
建议命令作为简易用途吧, 我们公司经常使用rdb文件迁移产品数据, 通常一台机器部署20个redis, 一堆配置文件不太好操作, 命令无论是书写还是使用shell编排都比较方便, 从aws迁移到国内云厂商的实战命令如下:
k8s命令创建部署:
k8s yaml创建部署
k8s helm创建部署
|
后面我再把default配置文件+命令的代码合过来, 这样公共的配置在文件, 可变的写在命令行, 就方便一些了 . |
我没有印象了,好像没有从最初就是要指定哪些字段从环境变量中读取没有用 viper 的自动解析。“Explicit is better than implicit.” @carlvine500 PR 的完成度很高,但是我个人还是不太想再引入一种配置方式。目前从环境变量解析部分配置文件的方式足够灵活也适合在你的场景下使用,“解决问题的最优方法应该有且只有一个” |
fix issue: #911
usage example:
./redis-shake rdb_reader -f /tmp/dump.rdb redis_writer -a 172.38.100.68:6379 advanced --ncpu=1
run result:
all help tips: