-
Notifications
You must be signed in to change notification settings - Fork 8
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
make --socket-path pull ETHERSYNC_SOCKET from env via clap #127
Conversation
a0159fe
to
d070693
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the thoughtful PR! Very cool that clap has a built-in feature for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems really good to me! ✨
The last thing I'd request is undoing the mode change on fuzzer.rs spotted by @zormit :)
After that, it'd be great if you could squash the small "fixup" commits into the others, and then we can merge this! 🎉
dd45e85
to
961b2fe
Compare
- remove ETHERSYNC_SOCKET conversion from nvim plugin - add info log for socket path if set from env in daemon
I want to merge it now and "Changes requested" is blocking this :)
Thanks for this, @cosmicexplorer! =) |
Problem
It's much easier to set
ETHERSYNC_SOCKET
via the environment for many use cases instead of modifying the command line, as noted by @zormit in #112 (comment). We currently do this by hand in the nvim plugin:ethersync/vim-plugin/plugin/ethersync.lua
Lines 69 to 72 in a41304a
We could do the same for the emacs plugin in #112, but it might be nice for the
ethersync
binary to support this itself.Solution
"env"
feature to ourclap
dependency.Arg::env()
for the globalsocket_path: PathBuf
argument.--socket-path
argument overrides this value; the env var is only read if the argument is not provided.ETHERSYNC_SOCKET
in addition to the client.ETHERSYNC_SOCKET
env var into--socket-path
.Result
All editor plugins (and the fuzzer) can expect to be able to set the
ETHERSYNC_SOCKET
environment variable as a separate way to parameterize the ethersync client, and users can setETHERSYNC_SOCKET
in their environment when invoking the daemon.