Skip to content
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

shell completion #126

Open
copy opened this issue Jun 6, 2017 · 6 comments
Open

shell completion #126

copy opened this issue Jun 6, 2017 · 6 comments
Labels
cli Command line related feature-request User wanted features

Comments

@copy
Copy link

copy commented Jun 6, 2017

Shell completion, similar to opam's would be useful and remove the need to write Makefiles in order to remember jbuilder's commands and build targets. I.e., when you type jbuilder build <tab>, it should list all build targets and jbuilder <tab> should list jbuilder's commands.

For reference, opam's completion scripts are here:

@ghost
Copy link

ghost commented Jun 7, 2017

It seems to me that cmdliner could help generating the completion. Most of the information in these scripts is already present in the description of the command line built with cmdliner

@copy
Copy link
Author

copy commented Jun 7, 2017

In that case, this issue is blocked by dbuenzli/cmdliner#1.

@ghost
Copy link

ghost commented Jun 7, 2017

I wouldn't say blocked, I'd welcome manually written scripts to support it. Although I'm not excited by the maintenance burden.

@ghost
Copy link

ghost commented May 5, 2021

Some news about this feature request: we are now using our own fork of cmdliner.

So if someone wants to work on this feature, it is acceptable to implement the feature in our fork. This should be easier than submitting it upstream given that it only needs to work for Dune rather than for everybody.

@arbipher
Copy link

arbipher commented Apr 2, 2023

The links to the opam's complete script are invalid now.

I would also suggest a shell completion for dune exec but I am not sure whether it's feasible.
e.g. I have an executable stanza hello for hello.ml. I expect
$ dune exec he --(press TAB to complete)--> $ dune exec hello.exe
rather than
$ dune exec he --(press TAB to complete)--> $ dune exec hello.ml

@Alizter
Copy link
Collaborator

Alizter commented Apr 2, 2023

@arbipher We don't have any completion scripts in Dune at the moment, so when you do he -> hello,ml that is just your terminal completing to whatever is in the current directory. We are working on completion in #6377 but I don't think we have anything for dune exec at the moment planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command line related feature-request User wanted features
Projects
None yet
Development

No branches or pull requests

5 participants