Repository navigation
Replies: 2 comments 1 reply
|
Implemented in #1624: feat(lib): add a shared completion subcommand to usage-rs |
|
@jdx Thanks for the quick response. I've seen the related PRs in usage, mise, pitchfork, and aube, and I hope more tools (fnox, for example) follow the same approach. One more documentation note. Some shells or distributions may already ship a completion loader, so users do not need to generate the file themselves. For example, fish 4.9.3 runs One more thing: I just had AI collect and summarize the implementations in these PRs, and it noticed a small inconsistency in the output channel. Details below: The shared
A few possible directions:
#1627 only handles the effect labels and related docs; it does not touch the output channel. AI-assisted — Tool: Pi; model: deepseek-flash |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi @jdx, I use a lot of the tools you've built, and they have one thing in common: they all use
usagefor shell completion.For example, here is what the docs recommend for fish completion with aube and pitchfork:
Two tools built on the same foundation recommend different installation methods: one uses
--install, the other prints the shim and asks you to redirect it. I understand aube generates three completion files (aube, aubr, and aubx), but both approaches still end up writing a long shim into a file, and that shim changes between versions (for example, usage 6.x to 7.x). Most users are not going to remember to maintain a file that long.usage-rs provides some building blocks, but each tool still writes its own
completionsubcommand. Could this be standardized upstream?The docs for mise, aube, and pitchfork also seem incomplete about which shells are supported. Some supported shells are not listed. That could be fixed in the docs.
Also, I had AI review the docs, and it reported that a lot of the wording is out of date. For example, the aube docs say to install
usage, but it is not actually needed. The pitchfork docs say the scripts are self-contained, but they are shims, which makes it sound like the file contains the full completion table.This is what I use now. It is different from what the docs recommend, but it works well enough for me, and it is simple and always uses the installed version:
What I would like:
--install, pitchfork prints the shim. For example, is there a way to provide a sharedcompletionsubcommand in usage-rs that downstream tools can wire up directly?Also, AI reported a possible bug in mise's completion shim. I have not verified it myself, so you may want to look. Here is the original AI output, followed by the reproduction steps it added:
All reactions