-
Notifications
You must be signed in to change notification settings - Fork 416
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 request: dune build@alias <paths>
to help with globbing and file-completion
#4537
Comments
I had exactly the same thought yesterday while I was testing dune with Jane Street code base. I personally like the proposal. Having proper support for completion in the Dune cli would be another way to improve the user experience, but this proposal is simpler and would work all the time. I'm forwarding it to other Dune devs for discussion. |
We discussed the proposal in today's meeting. We agree on the issue, but overall we are not too keen on the proposed solution. Among other reasons, it adds one more way to do the same thing and doesn't work when one wants to build multiple targets. Additionally, proper shell completion seems like a more general solution to this problem and doesn't require introducing a new syntax that users will have to learn. So for now we'd like to wait until we have shell completion. Once we have it, we can revisit this proposal if it still feels needed. BTW, I just updated the feature request for better shell competion to mention that we are now using a fork of cmdliner. This means that it should be easier to add shell completion to Dune this way. |
Shell completion solves only one of the two issues that I mentioned: shell completion. It does nothing for globing. I had this feature request in the back of my mind for some time, and decided to actually open this issue after I reviewed a change in our CI that introduced the following command: Additionally, and this is specific to my setup so I don't expect it to weigh much in the balance, I actually already have file completion because of vim's liberal acceptance of what constitute a path. In vim Globing is a powerful and pervasive tool I use everyday. I suspect I'm not the only one. |
An option that was discussed also was |
That would be a good solution. |
I'm currently using the following command to work around the inability to glob:
|
Desired Behavior
I want to be able to use globing and shell auto-completion on files, even when building aliases.
E.g., I can currently use
dune runtest src/lib_*
but I cannot usedune build @src/lib_*/check
Example
Currently I cannot do
dune build @src/lib_*/check
because the@
and thecheck
are part of the "path". Additionally I cannot tab complete on long paths because the@
at the beginning makes the shell interpret things not as path.How about allowing the form
dune build@<alias> <paths>
? E.g.,Note, this would render
dune runtest
anddune build@runtest
equivalent, and in fact it would generalise the use ofdune runtest
as a command that accepts any set of paths.The text was updated successfully, but these errors were encountered: