Azure / azure-cli

Azure Command-Line Interface
MIT License
3.95k stars 2.93k forks source link

No bash completion (or missing instructions) on Mac (Big Sur) #17828

Open berndverst opened 3 years ago

berndverst commented 3 years ago

Describe the bug A clean Homebrew install of Azure CLI used to include instructions for modifying .bash_profile or .zshrc to enable bash completion. This no longer appears to be the case.

To Reproduce Install Homebrew brew install zsh brew install azure-cli

No information provided on how to enable auto completions.

Expected behavior

Include helper command like az completion zsh that can be added, or provide instructions for how to properly enable completions.

After much digging I have determined this should be the following for ZSH:

autoload bashcompinit && bashcompinit
source $(brew --prefix)/etc/bash_completion.d/az

Note that brew --prefix most likely corresponds to /opt/homebrew

Environment summary

Mac OS 11.2.3. -- M1 Mac (ARM64) zsh 5.8 (arm-apple-darwin20.2.0)

brew --version
Homebrew 3.1.3
Homebrew/homebrew-core (git revision 7beae5ab57; last commit 2021-04-22)
Homebrew/homebrew-cask (git revision d0318692c3; last commit 2021-04-22)
az --version
azure-cli                         2.22.1

core                              2.22.1
telemetry                          1.0.6

Extensions:
azure-cli-ml                      1.25.0
subscription                       0.1.4
account                            0.2.1

Python location '/opt/homebrew/Cellar/azure-cli/2.22.1/libexec/bin/python'
Extensions directory '/Users/bverst/.azure/cliextensions'

Python (Darwin) 3.8.9 (default, Apr  2 2021, 17:46:14)
[Clang 12.0.0 (clang-1200.0.32.29)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy
yungezz commented 3 years ago

add @fengzhou-msft to help

danvy commented 2 years ago

I have the same issue trying to install az CLI 2.31.0 on Big Sur