Repository navigation
How to make shell completions work for modern versions of aliased just #3683
|
Yo, first off I want to thank you for working on just over the years. I really enjoy working with it for my projects. We at Universal blue have been using just extensively across our organization, for example to build our bootable container images. We have also been using your project as a means to ship little convenience scripts to common issues/tedious things on our Linux Operating systems. We have made a little wrapper script for this called ujust which we place in Over the years we have relied on a little hack to enable us to have shell completions for this "ujust" alias, we do this so we don't pollute the recipes from justfiles in the home directory of the users with the ones that the system ships with. There should be a clear separation between them. Recent changes in just regarding the completion engine have broken our little hack. In the past one could type in What currently happens on bash and fish is that files and directories are listed instead, on zsh it lists the recipes + the files. Is there a way to restore shell completions for our alias with modern versions of just? Have a nice day and thanks again! |
Replies: 1 comment 4 replies
|
Sorry for the inconvenience! To get things working, I think you'll need to patch the completion script that just prints out. If you look at the completions script in It's just a shim which calls just to print out the real completion script. It's that real completion script that you'll need to patch, I think by adding As for printing out files and directories in addition to recipes, that's an intentional change, since otherwise files and directories were being suppressed where you would actually want them. Let me know how it goes, and if you run into any problems. I've heard of Bazzite before, but didn't know that it shipped with just and a justfile for system tasks. Pretty cool! |
So i am writing a follow up here to update and share with the class, the bash completions were fixed for ujust by substituting
justwithujustin the completion script like we did beforeJUST_COMPLETE=bash just | sed 's/just/ujust/g' > /usr/share/bash-completion/completions/ujustand we updated the
ujustwrapper script tofor
fishwe just defined an aliasalias ujust='just --justfile "/usr/share/ublue-os/justfile"'and added that to/usr/share/fish/vendor_conf.d/ujust.fishfish would then automatically use the just completions for this alias.
lastly for
zshwe had to write a custom compdef wrapper and put t…