-
Notifications
You must be signed in to change notification settings - Fork 90
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 a cli param to specify the search path #1721
Conversation
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.
The code looks fine. As for the bikeshedding, I would be tempted to say that having a parameter of the same name as the environment variable might avoid confusion (also, just having --path
is not really clear; we could have --include-path
, but then the two names are really distinct and not even in a prefix relationship).
As for the delimiter, I honestly have no idea, but we should probably pick 5 compilers/interpreters that are both mainstream and known for having a good CLI UX, and research what they do, and why?
About the separator, the tradition with compilers is to just pass multiple |
@jneem what do you think about Viktor's answer? Should we make the CLI argument just take multiple values and sidestep the question of the delimiter entirely? At first sight it sounds more appealing/less error-prone than having two different delimiters. |
Yes, that sounds like a good plan, I'll try to find some time today to change it. I also had a quick look at some mainstream compilers (clang, gcc, rustc, ocamlc, ghc, javac). The multiple argument approach does indeed seem the most common (exceptions: ghc supports both multiple arguments and colon-separated arguments; javac supports only colon-separated arguments (I think: I only read the docs, didn't test)). The naming between env var and cli flag doesn't have a clear precedent. Most compilers seem to only support the short flag |
Another solution is to rename the env var |
While implementing this, it occurred to me that maybe "import" is better than "include", since that's what we call the operator? |
Sounds reasonable, indeed! |
This adds the cli argument version of the
NICKEL_PATH
environment variable. A couple points that could be bike-shedded:nickel
prefix is unnecessary? I think it's justified for the env var because it lives in a global namespace.