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

Fish shell completions #4

Closed
tosti007 opened this issue Nov 4, 2021 · 6 comments
Closed

Fish shell completions #4

tosti007 opened this issue Nov 4, 2021 · 6 comments

Comments

@tosti007
Copy link

tosti007 commented Nov 4, 2021

Hey there!

Currently there are no shell completions for swayhide, since I am a fish-shell user I thought I'd write my own and share them here.

I am making this an issue instead of a PR as I'm unsure where and wether or not you want this in the repo.

The full completion file swayhide.fish:

#
# Completions for swayhide
#

complete -c swayhide -s h -l help -d "Display help and exit"
complete -c swayhide -xa "(__fish_complete_subcommand)"
@NomisIV
Copy link
Collaborator

NomisIV commented Nov 5, 2021

This is looking great, and I'd love to package completions for all shells at some point!

The only problem I see is packaging the completion(s) with the rest of the program. The "official" installation method is using cargo, and I don't think it supports installing anything else than the actual rust binaries. So as I see it, completions require packaging. This is something I would like to avoid due to the extra overhead when bumping versions, but I see how it's most likely the only way forward.

swayhide is already in the AUR, but the install script would have to be modified. I'll let @WhyNotHugo know of that. I could also fix a nix flake, or possibly integration into nixpkgs for NixOS support. What distro are you running?

@WhyNotHugo
Copy link
Contributor

WhyNotHugo commented Nov 5, 2021

Cargo has no facilities to install this kind of thing. There's an open issue for it, but I don't expect it to change any time soon.

For distribution packages, it's trivial for packages to install this into the right location.

The usual approach is to just include it in contrib/ in the repo. Ping me if you add completions and I'll update the AUR package.

@ghost
Copy link

ghost commented Dec 27, 2021

completions would be nice, clap 3.0.0-beta has some stuff related to generating them but a /contrib would a fine way to handle
*edit: updated link

NomisIV added a commit that referenced this issue Apr 10, 2022
@NomisIV
Copy link
Collaborator

NomisIV commented Apr 10, 2022

@WhyNotHugo Completions are added now :)

@NomisIV NomisIV closed this as completed Apr 10, 2022
@tosti007
Copy link
Author

Hey there, thanks for adding it to the repo! About how to bundle the completions: I think the distro-specific package maintainers themselves should handle that, but I think it would be nice for the next releases to add the completion files within the release folder, as it allows the maintainers to download it all in one go and for the completions to be in sync with the releases.

@NomisIV
Copy link
Collaborator

NomisIV commented Apr 29, 2022

What release folder do you mean? The target/release folder after building the rust project with cargo build --release?

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

3 participants