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

How to create task's arguments autocompletion? #2023

Open
zekefast opened this issue May 2, 2024 · 3 comments
Open

How to create task's arguments autocompletion? #2023

zekefast opened this issue May 2, 2024 · 3 comments

Comments

@zekefast
Copy link

zekefast commented May 2, 2024

I have found no answer to the question in title in documentation nor GitHub issues nor PRs.
Is it possible to do something like that at all and if yes, could you please point me to documentation, source code or anything which can explain how to archive task arguments completion?

Below is a long explanation with example of what I would like to be able to do.

Let's say I created a task in my justfile with name task-a which accepts one argument with values x, y, z.

At the moment even if I setup auto completions for just (i.e. with source <(~/.cargo/bin/just --completions bash) command in ~/.bashrc) I wasn't able to type just task-a press and get auto completion suggestions for x, y, z. Or when I type just task-a w where w if first letter of x value and then press I would like to get completion to the full value of x.

Another example of this could be when I have task-b which accepts one argument which is a list (or filtered list) of files in a specific project directory. Then typing just task-b some-fi and then I would get a completion to just task-b some-file-name where some-file-name is a name of the file existing somewhere and implementation of task-b define where to find that file. In this case I don't assume just be smart enough to understand implementation of task-b I just want to explain (i.e. provide a path or mask to files) which can be used as potential variants for auto completion.

And thank you for the nice task runner! I really enjoy using it and extend my set of tasks almost every day!

@Animeshz
Copy link

Animeshz commented May 9, 2024

I was looking for something similar recently, did you found anything till now?

@zekefast
Copy link
Author

No, I am still waiting for answers preferably from maintainers of the project. Meanwhile I started to look how it can be done. I think if there is nothing out there I will try to implement it and submit PR. But definitely it'll take a bit of time, but I hope to be able to do it during next month of so.

@zekefast
Copy link
Author

@Animeshz You can also upvote my question on StackOverflow may be somebody notice it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants