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(completion): add zsh support #609

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

chenrui333
Copy link
Contributor

@chenrui333 chenrui333 commented May 1, 2024

📝 Description

  • feat(completion): add zsh support

✔️ How to Test

unit test


relates to Homebrew/homebrew-core#170570

Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: Rui Chen <rui@chenrui.dev>
@chenrui333 chenrui333 requested a review from a team as a code owner May 1, 2024 22:54
@chenrui333 chenrui333 requested review from lgarber-akamai and zliang-akamai and removed request for a team May 1, 2024 22:54
@jriddle-linode
Copy link
Contributor

You should be able to convert the bash completions using bashcompinit in zsh without having to make another completion config

@jriddle-linode jriddle-linode added the new-feature for new features in the changelog. label May 2, 2024
@lgarber-akamai
Copy link
Contributor

lgarber-akamai commented May 2, 2024

@chenrui333 I think we're planning on cutting a patch to get only #608 out given this PR will need a bit more vetting/testing. Will that work for you?

@chenrui333
Copy link
Contributor Author

yeah, that works for me.

command_template = Template(
"""$command)
command=(
'$actions --help'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing some weird outputs attempting to autocomplete on subcommands:

linode-cli linodes list\ create\ view\ update\ delete\ backups-list\ snapshot\ backups-cancel\ backups-enable\ backup-view\ backup-restore\ boot\ clone\ configs-list\ config-create\ config-view\ config-update\ config-delete\ config-interfaces-list\ config-interface-add\ config-interface-view\ config-interface-update\ config-interface-delete\ config-interfaces-order\ disks-list\ disk-create\ disk-view\ disk-update\ disk-delete\ disk-clone\ disk-reset-password\ disk-resize\ firewalls-list\ ips-list\ ip-add\ ip-view\ ip-update\ ip-delete\ migrate\ upgrade\ nodebalancers\ linode-reset-password\ reboot\ rebuild\ rescue\ resize\ shutdown\ transfer-view\ volumes\ types\ type-view\ --help

Dropping the quotes here seems to resolve the issue on my end 👍

Suggested change
'$actions --help'
'$actions --help'

@lgarber-akamai
Copy link
Contributor

lgarber-akamai commented Jun 4, 2024

@zliang-akamai Just to save you a bit of time for when you review this PR, I tested this PR with oh-my-zsh using the following:

make install
linode-cli completion zsh > ~/.oh-my-zsh/completions/_linodecli
compinit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature for new features in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants