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

tailscale: Generate completions from the CLI. #172679

Merged
merged 2 commits into from
May 24, 2024
Merged

Conversation

lgarron
Copy link
Sponsor Contributor

@lgarron lgarron commented May 24, 2024

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • [ x Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

tailscale command docs for the completion command:

> tailscale completion --help
Shell tab-completion scripts

USAGE
  tailscale completion <shell> [--flags] [--descs]

To load completions:

Bash:

	$ source <(tailscale completion bash)

	# To load completions for each session, execute once:
	# Linux:
	$ tailscale completion bash > /etc/bash_completion.d/tailscale
	# macOS:
	$ tailscale completion bash > $(brew --prefix)/etc/bash_completion.d/tailscale

Zsh:

	# If shell completion is not already enabled in your environment,
	# you will need to enable it.  You can execute the following once:

	$ echo "autoload -U compinit; compinit" >> ~/.zshrc

	# To load completions for each session, execute once:
	$ tailscale completion zsh > "${fpath[1]}/_tailscale"

	# You will need to start a new shell for this setup to take effect.

fish:

	$ tailscale completion fish | source

	# To load completions for each session, execute once:
	$ tailscale completion fish > ~/.config/fish/completions/tailscale.fish

PowerShell:

	PS> tailscale completion powershell | Out-String | Invoke-Expression

	# To load completions for every new session, run:
	PS> tailscale completion powershell > tailscale.ps1
	# and source this file from your PowerShell profile.

The shell scripts and this help message have been adapted from the
Cobra project (https://cobra.dev, https://github.com/spf13/cobra)
under the Apache-2.0 license. Thank you for making these available.


SUBCOMMANDS
  bash        Generate bash shell completion script
  zsh         Generate zsh shell completion script
  fish        Generate fish shell completion script
  powershell  Generate powershell completion script

I've verified that the updated formula install completions for my shell (fish).

@github-actions github-actions bot added the go Go use is a significant feature of the PR or issue label May 24, 2024
Copy link
Contributor

🤖 An automated task has requested bottles to be published to this PR.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label May 24, 2024
@BrewTestBot BrewTestBot added this pull request to the merge queue May 24, 2024
Merged via the queue into Homebrew:master with commit 1c14a24 May 24, 2024
14 checks passed
@github-actions github-actions bot added the outdated PR was locked due to age label Jun 23, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. go Go use is a significant feature of the PR or issue outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants