Skip to content

brew: setup shell completion #3

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

Closed
wants to merge 2 commits into from
Closed

Conversation

jkroepke
Copy link

@jkroepke jkroepke commented Mar 14, 2025

This PR add the automatic setup of shell completion for StackIT CLI.

Docs: https://rubydoc.brew.sh/Formula#generate_completions_from_executable-instance_method

Ref for kubectl: https://github.com/Homebrew/homebrew-core/blob/33a3f1b400026561ff01cd8f7647a0503a06cbf7/Formula/k/kubernetes-cli.rb#L39C5-L39C41

Tested locally:

jok@jok-air ~ % curl https://raw.githubusercontent.com/jkroepke/homebrew-tap/refs/heads/patch-1/Formula/stackit.rb -O
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2007  100  2007    0     0   3778      0 --:--:-- --:--:-- --:--:--  3779
jok@jok-air ~ % brew install stackit.rb
Error: Failed to load cask: stackit.rb
Cask 'stackit' is unreadable: wrong constant name #<Class:0x00000001257233e8>
Warning: Treating stackit.rb as a formula.
==> Fetching stackit
==> Downloading https://github.com/stackitcloud/stackit-cli/releases/download/v0.26.0/stackit-cli_0.26.0_darwin_arm64.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/699237555/60f3124a-f258-4a4b-a1d6-9e17eaaf03db?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseas
##################################################################################################################################################################################################### 100.0%
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Summary
🍺  /opt/homebrew/Cellar/stackit/0.26.0: 9 files, 41.3MB, built in 3 seconds
==> Running `brew cleanup stackit`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

@jkroepke jkroepke marked this pull request as ready for review March 14, 2025 18:15
@jkroepke
Copy link
Author

jkroepke commented Apr 5, 2025

@marceljk Could you take a look here as well?

@marceljk
Copy link

marceljk commented Apr 7, 2025

Hi @jkroepke, thanks for your contribution.

# This file was generated by GoReleaser. DO NOT EDIT.
It looks like the file is generated and with the next version of the CLI this will be overwritten. I'll check this

@marceljk
Copy link

marceljk commented Apr 9, 2025

Hi @jkroepke,

the shell completion is now added within the goreleaser and with the next release, this will be added to the homebrew tap. (see stackitcloud/stackit-cli#692)

Thanks for your contribution 😃

@marceljk marceljk closed this Apr 9, 2025
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