-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fish shell completions #912
Comments
I see the problem here that httpie is not really responsible for the installation process. This is done by the package maintainers of your Linux distribution (if you installed from the repositories as advised in the README). Hence, a packaging request would need to be filed at the respective distribution's issue tracker. For example, I filed a request for Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1834441 |
Is there really no way for httpie to add to what is unpacked in the installation process, and default-including the completions file? Edit: I see now that the completion does exist here https://github.com/jakubroztocil/httpie/blob/master/extras/httpie-completion.fish - but it still seems very inefficient to have to request this to be installed by every distribution. |
I would also say that the request you made should be updated. For the fish shell, the default should be to install them into |
I guess having a packaging guide of sorts would make it easier for maintainers to produce better packages. The only kind-of-official non-PyPi package is the Homebew formula, and I now realise that not even there the completions get installed. I assume that there’s no reliable way to install the *shell completions with @exploide thanks for the Fedora request 👍 |
You mean a
Depends on what you mean with installation process. One can install httpie via different means. If you use your Linux distribution's package management, then it's up to them. httpie is not involved in the packaging process. That's how it works.
That could be helpful. Some projects even maintain the spec file for RPM and whatever is needed for DEB packages in their repository. But distro maintainers would need to pick that up and coordinating effort would be necessary. Don't know how feasible that is right now.
In theory,
While I have literally no experience with MacOS X and Homebrew, I think I have read something about homebrew packages installing autocompletion files somehow. |
Ok, I did not know it was this involved. Reading the repos of other tools such as fd, hyperfine, bat etc. I could not find anything related to that they had to request this from package maintainers, but not saying they haven't. We all learn something new every day 😄 |
Additionally, things become different for other programming languages and environments. The Rust tool Packaging is a mess 🙄 PS: It is not always necessary to request that from package maintainers. Often they find the files by themselves within the source and include them. But they are all human beings and some don't care initially about shell completions and some others have no idea what the heck fish is 😄 |
Fish core developer here. We are always happy to upstream completions directly into the fish codebase, if you like. Fish ships with hundreds of hand-written "dynamic" completions that go far beyond merely state-machine-based deduction of autocompletion parameters and can provide "dynamic" logic based on introspecting the command line and even executing commands at runtime (e.g. the |
Oh yes, apparently I forgot to mention this option despite I recently contributed completions to fish by myself 😄 So if the httpie project would like to hand over the completion file to fish itself, that would make things more seamless for fish users. A possible drawback to note: It can then happen that the installed version of httpie is not in sync with the file installed with the version of fish. Users could see outdated or missing options from the completion. Don't know if this is negligible since currently most fish users have no httpie completions at all (despite the autogenerated ones). |
Thanks for dropping in, @mqudsi! Including the completions in the fish codebase would indeed be the most robust solution. @exploide’s note about the possible version mismatch is valid, though—is there a standard way of dealing with that, e.g., by supporting multiple versions of the command being autocompleted simultaneously? |
I would not call that a standard way but yes. Some completion files that suffer the same problem try to solve that by checking |
I’m playing with idea of providing a built-in API for the shell completions (maybe using something like @kislyuk’s https://github.com/kislyuk/argcomplete). Then the shell-specific completions scripts could be pretty minimal and hopefully version agnostic. |
It would be amazing if httpie could default-install completions for the awesome fish shell.
Reference: https://fishshell.com/docs/current/#where-to-put-completions
Example of other great tools that does this:
The text was updated successfully, but these errors were encountered: