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

feat: tab-completion for zsh and bash #1419

Merged
merged 7 commits into from
Sep 14, 2024
Merged

Conversation

grimcore
Copy link
Contributor

@grimcore grimcore commented Sep 12, 2024

This completion option is for zsh only at the moment, if you like what you see or have suggestions for what other shells I should make it for tell me and I'll do my best.

ani-cli --completion > _ani-cli && echo 'source /path/to/_ani-cli' >> ~/.zshrc

Really enjoying the tool itself btw 💜

image

@grimcore grimcore closed this Sep 12, 2024
@grimcore grimcore reopened this Sep 12, 2024
@port19x
Copy link
Collaborator

port19x commented Sep 12, 2024

Bash completion would be nice

@grimcore
Copy link
Contributor Author

Bash completion would be nice

I'll work on that tomorrow, if I got time.

@port19x
Copy link
Collaborator

port19x commented Sep 12, 2024

Also, I'd prefer to have the completion data separate file that people can install as you show in your screenshot

@port19x
Copy link
Collaborator

port19x commented Sep 12, 2024

Otherwise this looks good

@grimcore
Copy link
Contributor Author

The idea was tho add options for every shell that is gonna be implemented for it.
So that u can just type

ani-cli --completion <shell> 

Didn't add the last part since I just tried it with zsh for a start.

@grimcore
Copy link
Contributor Author

Now it should work for bash and zsh.

ani-cli --completion > _ani-cli && source _ani-cli

detects the shell automatically

@port19x
Copy link
Collaborator

port19x commented Sep 13, 2024

The problem I have with this is that the script gets bloated 120 lines for a glorified print.

Please make these things separate files in the repo and document their use in the README

@grimcore
Copy link
Contributor Author

grimcore commented Sep 13, 2024

I have 2 options for you here.

One where you just need to execute the script and another one that requires you to move and source the completion file one your own.
After you told me which one you like better, I'll edit the read me accordingly.

Which should it be?

@port19x
Copy link
Collaborator

port19x commented Sep 13, 2024

Thanks, I prefer the manual way.
Is the new line at the top intentional for those files btw?

@grimcore
Copy link
Contributor Author

Okay then I'll edit it according to that.

No I copied them from the original script and it just happens to be the case that nvim pastes under and not on the line you are on.

And one more thing... how are the people that use their package manager to install ani-cli use this now?
That was the original thought behind me adding it to the main script.

@grimcore
Copy link
Contributor Author

I mean without doing an extra step and downloading from github anyway

@port19x
Copy link
Collaborator

port19x commented Sep 13, 2024

Packagers could work around this, or they would need to fetch the completion info manually.

I believe this is fine, because the people that would see --completion in help output and successfully set it up that way are the same people that will carefully read the readme anyway

@grimcore
Copy link
Contributor Author

Hope that it's to your liking now @port19x !
And thanks for being patient with me. 💜

@port19x port19x changed the title tab-completion for zsh feat: tab-completion for zsh Sep 14, 2024
@port19x port19x changed the title feat: tab-completion for zsh feat: tab-completion for zsh and bash Sep 14, 2024
@port19x port19x merged commit b9c6eb9 into pystardust:master Sep 14, 2024
9 of 10 checks passed
@port19x
Copy link
Collaborator

port19x commented Sep 14, 2024

Thanks for the contribution

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

Successfully merging this pull request may close these issues.

2 participants