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 shell completion for zsh #1166 #1216

Closed
wants to merge 1 commit into from
Closed

Conversation

tony-sol
Copy link
Contributor

@tony-sol tony-sol commented Jun 12, 2023

Add brew bundle completion for zsh #1166

brew-bundle brew-bundle-list

For bash / fish may be added later.

@tony-sol tony-sol force-pushed the master branch 3 times, most recently from e967a86 to eb3422c Compare June 12, 2023 02:16
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Can you split the completions and dump selection into separate PRs? Thanks!

.gitignore Outdated
Comment on lines 2 to 3
.vscode

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.vscode
.vscode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MikeMcQuaid done:)

This PR contains only zsh-completion script

dump command logic updated in #1217 and should be reviewed and merged after this PR, thanks:)

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Great work so far!

completions/zsh/brew-bundle Outdated Show resolved Hide resolved

_brew_bundle_install() {
_arguments \
'--file[read the Brewfile from this location. Use --file=- to pipe to stdin/stdout]' \
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if there's any way to rely on any of the Homebrew/brew code to autogenerate some/all of this or at least have CI to ensure it's kept in sync?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't research that :c
I know there are some tools to automate this script creation in golang, but not sure for ruby

Copy link
Member

Choose a reason for hiding this comment

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

No worries, I'll try to help! Check out:

https://github.com/Homebrew/brew/blob/a56a2707075a10827b4c49b3cc51cae7bb94c2d6/completions/zsh/_brew#L4-L6

and

https://github.com/Homebrew/brew/blob/a56a2707075a10827b4c49b3cc51cae7bb94c2d6/Library/Homebrew/completions.rb

which you could maybe use for auto-generation?

Don't worry if you can't handle the e.g. GitHub Actions side: I can help with all that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, i'm not good at ruby (actually, it's my first try), but after some research of given code, i think i can make similar for brew bundle.
It requires some refactoring and i think, i would make it, if may

Copy link
Member

Choose a reason for hiding this comment

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

@tony-sol just wanted to check how things are going and what you're thinking! Thanks again for the PR!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MikeMcQuaid sorry, i've been unlucky with free time lately :c

i remember about this PR, but can't say, when could continue work on it :c

Copy link
Member

Choose a reason for hiding this comment

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

@tony-sol No worries! Just saw the rebase and wanted to check!

@tony-sol tony-sol force-pushed the master branch 3 times, most recently from 96bbff1 to b7b378a Compare June 18, 2023 15:56
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Jul 11, 2023
@github-actions github-actions bot closed this Jul 18, 2023
@colindean
Copy link
Member

@MikeMcQuaid Would it be acceptable to accept this without the autogen and then for someone else revisit that autogen later?

@MikeMcQuaid
Copy link
Member

@colindean My fear is that without autogen this is going to be a pain to maintain and avoid bitrotting.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants