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
feature: support command line arguments in a configuration file #1823
Conversation
…d master -config=master.conf`, `weed volume -config=volume.conf` and etc.
How to see the full list of command line options in effect? |
This breaks the help message for
After this PR, the corresponding part became:
|
It is fixed. |
Thanks a lot! |
Merged. It would be better if the config file content is printed out when the program starts. |
Yes, some additional work can be do :
And any suggestion more ? |
One bug with this approach is that the command line option can not duplicate with existing environment variables. For example, if It should only read env variable $WEED_CLI_XXXX, e.g., $WEED_CLI_PATH. |
Yes, it is really a bug, I should set env prefix to a default "WEED_", a pr will be submit ASAP. |
direct command line is too long like:
weed -logdir=../mlog master -mdir=../mdir -peers=192.168.126.5:3333,192.168.126.16:3333,192.168.126.18:3333 -port=3333 -defaultReplication=001
after applying this feature, we can use a configuration file like:
then refer it like
weed master -config=master.conf
Order of precedence of this flag, it is borrowed from https://github.com/namsral/flag with some customized for weed:
So, if someone like command lines, old style is still there. If someone get boring with so many command line arguments, he can use a configuration file as an alternative. Why not!