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

added zsh completion #132

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

RiedleroD
Copy link

@RiedleroD RiedleroD commented Jul 13, 2024

This should have feature parity with the bash completion, with some minor improvements caused by the way zsh completion works.

things to support:

  • gbsplay
  • gbsinfo
  • gbs2gb
  • gbs2ogg

note to self: update gbsplay-git AUR package when merged, to move the completion file to the correct spot

@RiedleroD
Copy link
Author

I'm not sure how to use gbs2gb… there's no docs and idk what exactly this "rom template" it needs is

@RiedleroD RiedleroD marked this pull request as ready for review July 13, 2024 01:34
@mmitch mmitch self-assigned this Jan 25, 2025
@mmitch mmitch added this to the 0.0.98 milestone Jan 25, 2025
@mmitch
Copy link
Owner

mmitch commented Jan 26, 2025

@RiedleroD sorry for the loooong wait, I did not have any time for gbsplay sooner (and neither did anybody else it seems).

Regarding gbs2gb: I also don't know what gbs2gb is for and how to use it. I think it is a converter to turn a .gbs file back into a proper .gb file that can run on real hardware or a full-blown GameBoy emulator. I think it was written to be able to test if gbsplay could also play full-blown .gb files instead of only .gbs sound extracts.
I don't think that commandline completion for gbs2gb is necessary, but it does not hurt either.

As I don't use ZSH, I have a question: How do I use, load or activate your completions?

I've installed zsh and looked around for existing completion definitions on my Debian system: I have lots of files under /usr/share/zsh/functions/Completion/, but they all start with a #compdef line that your completion file does not have. Also all those files have a filename starting with _. I think that's because they can be autoloaded(?) and the filename bemones the function name (so they have a _ prefix so that they don't show up as regular commands.

What do I have to do after starting zsh to activate the completions from your gbsplay.zshcompletion file?

@RiedleroD
Copy link
Author

no worries ^^ better late than never, and I'm getting ghosted by open-source devs pretty regularly anyway.

It's been a while since I've touched the code, but it seems that on my machine I've put the file at /usr/share/zsh/site-functions/_gbsplay. restarting zsh should suffice to load it. I think. it's been a while 😅 if it doesn't work, try checking zsh manual for enabling completion in general for your distro.

um… the completion file does start with a compdef? I'm not sure what you mean.

Yes, the completion file is meant to be copied into the right place with the right filename by whatever distribution someone is using. e.g. the AUR package for gbsplay installs the current bash completion via install -Dm644 gbsplay.bashcompletion "$pkgdir"/etc/bash_completion.d/gbsplay. Did I fuck something up in the Makefile, or…?

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

Successfully merging this pull request may close these issues.

2 participants