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

[Feature Request] Upstream the zsh completions #173

Closed
NicolaSmaniotto opened this issue Jan 31, 2022 · 8 comments
Closed

[Feature Request] Upstream the zsh completions #173

NicolaSmaniotto opened this issue Jan 31, 2022 · 8 comments

Comments

@NicolaSmaniotto
Copy link

It would be nice to upstream the zsh completions file present in the AUR, to make it available for other distributions and have a place to maintain it in case something changes in the future.

@iamkroot
Copy link
Owner

Thanks for creating the issue! I've been lazy about this, and I looked into it a bit.

We use Cleo under the hood to create the CLI, and turns out, it has built-in support for bash, zsh and fish autocompletions).

You just need to follow the steps from the link and the completions will be generated!
@ahmubashshir Maybe you can update the PKGBUILD to do this instead of pre-generating them?

@ahmubashshir
Copy link
Contributor

ahmubashshir commented Jan 31, 2022 via email

@ahmubashshir
Copy link
Contributor

ahmubashshir commented Jan 31, 2022 via email

@ahmubashshir
Copy link
Contributor

The autogenerated completion for zsh is a bit buggy, it autocompletes path even if the command will not accept the path.

image
image

these ones are autogenerated.

ahmubashshir added a commit to ahm-forks/trakt-scrobbler that referenced this issue Jan 31, 2022
See-also: iamkroot#173

Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
@NicolaSmaniotto
Copy link
Author

PR #174 is a good thing, thanks @ahmubashshir. I'd have opened it myself, but I'm not familiar with the AUR's licensing.

As soon as I have some time I'll play a bit with cleo's autogenerated completions, those would solve every issue.

@NicolaSmaniotto
Copy link
Author

The autogenerated completion for zsh is a bit buggy, it autocompletes path even if the command will not accept the path.

image

This seems to be python-poetry/cleo#85, which would be solved by merging python-poetry/cleo#86.

@iamkroot
Copy link
Owner

iamkroot commented Feb 2, 2022

Yeah, the cleo autogenerated completions don't seem to support sub-commands. It is only providing top-level command completions, along with their optional flags.

I realize, this is closely related to poetry's commands using --verb style args to handle subcommands (they do poetry config --list instead of poetry config list). Not sure I like passing subcommands as flags. (Poetry and cleo were written by the same person)

@ahmubashshir's completions are definitely more complete (pardon the pun :P)

@NicolaSmaniotto
Copy link
Author

My thought exactly. It's sad, but cleo seems to be pretty limited to what the dev needs it to do for poetry.

The issue to complete subcommands was opened as python-poetry/cleo#84 in september 2020, with ho response yet.

I patched my cleo install with python-poetry/cleo#86, and it solves the "bad set [...] array" problem, but that too was opened in september 2020 and still not merged.

I agree that the best approach for now is #174, at least until cleo adds the missing features.

ahmubashshir added a commit to ahm-forks/trakt-scrobbler that referenced this issue Feb 5, 2022
See-also: iamkroot#173

Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
ahmubashshir added a commit to ahm-forks/trakt-scrobbler that referenced this issue Feb 5, 2022
See-also: iamkroot#173

Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
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