From 6acc66fe0e67d3885cd82ccdf89d0ed2a8f81747 Mon Sep 17 00:00:00 2001 From: Hang Date: Fri, 29 Nov 2024 11:42:17 +0800 Subject: [PATCH 1/5] Init --- .gitignore | 1 + .../includes/cli-install-linux-apt.md | 2 ++ .../includes/cli-install-linux-dnf.md | 2 ++ .../includes/cli-install-linux-tdnf.md | 2 ++ .../includes/linux-completion.md | 20 +++++++++++++++++++ .../install-azure-cli-macos.md | 2 +- 6 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 docs-ref-conceptual/includes/linux-completion.md diff --git a/.gitignore b/.gitignore index 023f65b8d5..83260b908c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ _themes/ _themes.MSDN.Modern/ _themes.VS.Modern/ .vscode +.idea .openpublishing.buildcore.ps1 *.swp diff --git a/docs-ref-conceptual/includes/cli-install-linux-apt.md b/docs-ref-conceptual/includes/cli-install-linux-apt.md index d53cbbd4db..a26ec4e4a0 100644 --- a/docs-ref-conceptual/includes/cli-install-linux-apt.md +++ b/docs-ref-conceptual/includes/cli-install-linux-apt.md @@ -237,3 +237,5 @@ If your proxy doesn't use basic auth, __remove__ the `[username]:[password]@` po In order to get the Microsoft signing key and get the package from our repository, your proxy needs to allow HTTPS connections to the following address: `https://packages.microsoft.com. [!INCLUDE[troubleshoot-wsl.md](troubleshoot-wsl.md)] + +[!INCLUDE[linux-completion.md](linux-completion.md)] diff --git a/docs-ref-conceptual/includes/cli-install-linux-dnf.md b/docs-ref-conceptual/includes/cli-install-linux-dnf.md index f1265f62cf..f9d62a96c6 100644 --- a/docs-ref-conceptual/includes/cli-install-linux-dnf.md +++ b/docs-ref-conceptual/includes/cli-install-linux-dnf.md @@ -193,3 +193,5 @@ allow HTTPS connections to the following address: * `https://packages.microsoft.com` [!INCLUDE[troubleshoot-wsl.md](troubleshoot-wsl.md)] + +[!INCLUDE[linux-completion.md](linux-completion.md)] diff --git a/docs-ref-conceptual/includes/cli-install-linux-tdnf.md b/docs-ref-conceptual/includes/cli-install-linux-tdnf.md index 30b84102b9..cc23ac6071 100644 --- a/docs-ref-conceptual/includes/cli-install-linux-tdnf.md +++ b/docs-ref-conceptual/includes/cli-install-linux-tdnf.md @@ -61,3 +61,5 @@ sudo tdnf remove azure-cli ### Remove data [!INCLUDE [remove-data-boilerplate.md](remove-data-boilerplate.md)] + +[!INCLUDE[linux-completion.md](linux-completion.md)] diff --git a/docs-ref-conceptual/includes/linux-completion.md b/docs-ref-conceptual/includes/linux-completion.md new file mode 100644 index 0000000000..1be7b91fcf --- /dev/null +++ b/docs-ref-conceptual/includes/linux-completion.md @@ -0,0 +1,20 @@ +--- +author: bebound +ms.author: hanglei +ms.date: 11/29/2024 +ms.topic: include +--- +### Completion isn't working + +For Bash users, the completion script is installed in `/etc/bash_completion.d/azure-cli`, which should be loaded automatically. If it doesn't work, you can manually add the following line to your `~/.bashrc` file, then save and reload your Bash profile: + +```bash +source /etc/bash_completion.d/azure-cli +``` + +For Zsh users, please add the following two lines in your `~/.zshrc` file, then save and reload your Zsh profile: + +```zsh +autoload -U +X bashcompinit && bashcompinit +source /etc/bash_completion.d/azure-cli +``` diff --git a/docs-ref-conceptual/install-azure-cli-macos.md b/docs-ref-conceptual/install-azure-cli-macos.md index d9d9e571a5..2a8357d426 100644 --- a/docs-ref-conceptual/install-azure-cli-macos.md +++ b/docs-ref-conceptual/install-azure-cli-macos.md @@ -38,7 +38,7 @@ If you encounter a problem when installing the CLI through Homebrew, here are so ### Completion isn't working -The Homebrew formula of Azure CLI installs a completion file named `az` in the Homebrew-managed completions directory (default location is `/usr/local/etc/bash_completion.d/`). To enable completion, follow Homebrew's instructions [here](https://docs.brew.sh/Shell-Completion). +The Homebrew formula of Azure CLI installs a completion file named `az` in the Homebrew-managed completions directory (default location is `$(brew --prefix)/etc/bash_completion.d/`). To enable completion, follow Homebrew's instructions [here](https://docs.brew.sh/Shell-Completion). For Zsh, add the following two lines to the bottom of your `.zshrc` file, then save and reload your Zsh profile. From 2bb564aec65c345ca78112dc872555e3744fd7c8 Mon Sep 17 00:00:00 2001 From: Hang Date: Fri, 29 Nov 2024 12:40:44 +0800 Subject: [PATCH 2/5] Minor fix --- docs-ref-conceptual/includes/linux-completion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-ref-conceptual/includes/linux-completion.md b/docs-ref-conceptual/includes/linux-completion.md index 1be7b91fcf..d4d150d440 100644 --- a/docs-ref-conceptual/includes/linux-completion.md +++ b/docs-ref-conceptual/includes/linux-completion.md @@ -6,7 +6,7 @@ ms.topic: include --- ### Completion isn't working -For Bash users, the completion script is installed in `/etc/bash_completion.d/azure-cli`, which should be loaded automatically. If it doesn't work, you can manually add the following line to your `~/.bashrc` file, then save and reload your Bash profile: +For Bash users, the completion script is installed in `/etc/bash_completion.d/azure-cli`. Please add the following line to your `~/.bashrc` file, then save and reload your Bash profile: ```bash source /etc/bash_completion.d/azure-cli From 08a68f173f06c3ec61199ee08b10cc18dffa8b74 Mon Sep 17 00:00:00 2001 From: Hang Date: Mon, 2 Dec 2024 11:02:03 +0800 Subject: [PATCH 3/5] Minor fix --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 83260b908c..023f65b8d5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ _themes/ _themes.MSDN.Modern/ _themes.VS.Modern/ .vscode -.idea .openpublishing.buildcore.ps1 *.swp From 4822727b13c099a45604f5914a24251f3b67344e Mon Sep 17 00:00:00 2001 From: Hang Date: Mon, 16 Dec 2024 15:22:57 +0800 Subject: [PATCH 4/5] Apply suggestions from code review Co-authored-by: Delora Bradish --- docs-ref-conceptual/includes/cli-install-linux-tdnf.md | 2 ++ docs-ref-conceptual/includes/linux-completion.md | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs-ref-conceptual/includes/cli-install-linux-tdnf.md b/docs-ref-conceptual/includes/cli-install-linux-tdnf.md index cc23ac6071..fba1977b22 100644 --- a/docs-ref-conceptual/includes/cli-install-linux-tdnf.md +++ b/docs-ref-conceptual/includes/cli-install-linux-tdnf.md @@ -62,4 +62,6 @@ sudo tdnf remove azure-cli [!INCLUDE [remove-data-boilerplate.md](remove-data-boilerplate.md)] +## Troubleshooting + [!INCLUDE[linux-completion.md](linux-completion.md)] diff --git a/docs-ref-conceptual/includes/linux-completion.md b/docs-ref-conceptual/includes/linux-completion.md index d4d150d440..ba06398e4b 100644 --- a/docs-ref-conceptual/includes/linux-completion.md +++ b/docs-ref-conceptual/includes/linux-completion.md @@ -6,13 +6,13 @@ ms.topic: include --- ### Completion isn't working -For Bash users, the completion script is installed in `/etc/bash_completion.d/azure-cli`. Please add the following line to your `~/.bashrc` file, then save and reload your Bash profile: +For Bash users, the completion script is installed in `/etc/bash_completion.d/azure-cli`. Add the following line to your `~/.bashrc` file, then save and reload your Bash profile: ```bash source /etc/bash_completion.d/azure-cli ``` -For Zsh users, please add the following two lines in your `~/.zshrc` file, then save and reload your Zsh profile: +For Zsh users, add the following two lines in your `~/.zshrc` file, then save and reload your Zsh profile: ```zsh autoload -U +X bashcompinit && bashcompinit From dd4ed0a4b9804b923d61b7e0a5a16801a17a7721 Mon Sep 17 00:00:00 2001 From: Hang Date: Mon, 6 Jan 2025 15:46:57 +0800 Subject: [PATCH 5/5] Update docs-ref-conceptual/includes/linux-completion.md Co-authored-by: Jiashuo Li <4003950+jiasli@users.noreply.github.com> --- docs-ref-conceptual/includes/linux-completion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-ref-conceptual/includes/linux-completion.md b/docs-ref-conceptual/includes/linux-completion.md index ba06398e4b..6fe4104451 100644 --- a/docs-ref-conceptual/includes/linux-completion.md +++ b/docs-ref-conceptual/includes/linux-completion.md @@ -6,7 +6,7 @@ ms.topic: include --- ### Completion isn't working -For Bash users, the completion script is installed in `/etc/bash_completion.d/azure-cli`. Add the following line to your `~/.bashrc` file, then save and reload your Bash profile: +For Bash users, the completion script is installed in `/etc/bash_completion.d/azure-cli`. If it is not automatically executed, add the following line to your `~/.bashrc` file, then save and reload your Bash profile: ```bash source /etc/bash_completion.d/azure-cli