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

Add install-bash-completion and install-shell-completion targets #444

Closed
wants to merge 1 commit into from

Conversation

strk
Copy link
Contributor

@strk strk commented Dec 14, 2023

I've only done bash as I use bash and have no idea how zsh and fish deal with custom completion files

@strk strk marked this pull request as draft December 14, 2023 10:51
@strk
Copy link
Contributor Author

strk commented Dec 14, 2023

The completion seems to be not working with the click branch, will check if it works with the master branch

@ihabunek
Copy link
Owner

It's only implemented on the click branch. Not yet merged to master. It works for me on zsh.

@strk
Copy link
Contributor Author

strk commented Dec 14, 2023

For bash it fails:

eval "$(_TOOT_COMPLETE=bash_source toot)"
Unknown command '-'
Run toot --help to show a list of available commands.
v0.39.0: command not found
Authentication:: command not found
bash: syntax error near unexpected token `('

Is this something supposed to be implemented by click itself ?

@strk
Copy link
Contributor Author

strk commented Dec 14, 2023

It looks like _TOOT_COMPLETE env variable has no effects at all on toot:

$ _TOOT_COMPLETE=bash_source toot
toot - a Mastodon CLI client
v0.39.0

Authentication:
  toot login            Log into a mastodon instance using your browser (recommended)
...

I guess it would be a lot safer to just build the completion scriptsi on make and install the generated output, rather than calling the dangerous eval on every new shell

@ihabunek ihabunek deleted the branch ihabunek:click December 14, 2023 11:08
@ihabunek ihabunek closed this Dec 14, 2023
@strk
Copy link
Contributor Author

strk commented Dec 14, 2023

this PR continues in #446

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