mirror of
https://github.com/spf13/cobra
synced 2025-08-13 13:17:50 +00:00
Adjust bash completion instructions for compatibility with bash 3.2
Bash 3.2 is the default shell on macOS Mojave and other OSs, but the old instructions for sourcing completion scripts into one's shell don't work with it: ``` . <(cmd completion) ``` This is because the `source` (`.`) builtin doesn't work with process substitution in 3.2. https://lists.gnu.org/archive/html/bug-bash/2006-01/msg00018.html The `eval` approach is portable between different bash versions.
This commit is contained in:
parent
3745fcd262
commit
3a8f0055e6
1 changed files with 2 additions and 2 deletions
|
@ -17,12 +17,12 @@ var completionCmd = &cobra.Command{
|
|||
Short: "Generates bash completion scripts",
|
||||
Long: `To load completion run
|
||||
|
||||
. <(bitbucket completion)
|
||||
eval "$(bitbucket completion)"
|
||||
|
||||
To configure your bash shell to load completions for each session add to your bashrc
|
||||
|
||||
# ~/.bashrc or ~/.profile
|
||||
. <(bitbucket completion)
|
||||
eval "$(bitbucket completion)"
|
||||
`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
rootCmd.GenBashCompletion(os.Stdout);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue