Skip to content

Conversation

@bartekpacia
Copy link
Member

@bartekpacia bartekpacia commented Nov 24, 2024

This PR fixes a bug in completion scripts when the binary is called in any other way than by simply typing its name. Examples:

  • When installing my program emu with Homebrew, os.Args[0] is /opt/homebrew/Cellar/emu/0.2.16/bin/emu.

  • When running my program emu like this: ./emu, then os.Args[0] is ./emu.

This breaks the completion script.
I think using root command's cmd.Name is a good way to fix it.

Also discussed here

@bartekpacia bartekpacia requested a review from a team as a code owner November 24, 2024 21:38
@bartekpacia bartekpacia merged commit 6d4e81c into main Nov 25, 2024
15 checks passed
@bartekpacia bartekpacia deleted the bartekpacia/fix/completion_script_executable_name branch November 25, 2024 13:30
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.

3 participants