From 3396387b52ed835c8ee394e35c1a9c3bdb0e320d Mon Sep 17 00:00:00 2001 From: Randall Wood Date: Sun, 13 Aug 2017 08:46:48 -0400 Subject: Remove "*instal" aliases from bash completion Remove all command aliases ending in "instal" (single letter L) from the bash completion. This has the practical effect of removing the aliases "instal" and "uninstal" from bash completion, allowing "install" and "uninstall" to be auto completed once the first three characters of each "ins" or "uni" are typed in.--- completions/bash/brew | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/completions/bash/brew b/completions/bash/brew index 03a05cb37..ac1fd3e4f 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -563,10 +563,10 @@ _brew() { if [[ "$i" -eq "$COMP_CWORD" ]] then - # Do not auto-complete "instal" abbreviation for "install" command. + # Do not auto-complete "*instal" abbreviations for "*install" commands. # Prefix newline to prevent not checking the first command. - local cmds=$'\n'"$(brew commands --quiet --include-aliases)" - __brewcomp "${cmds/$'\n'instal$'\n'/$'\n'}" + local cmds=$'\n'"$(brew commands --quiet --include-aliases | grep -v instal$)" + __brewcomp "${cmds}" return fi -- cgit v1.2.3 From d7baf8137325b27f3ae45bca430d1db25af8bb62 Mon Sep 17 00:00:00 2001 From: Randall Wood Date: Sun, 13 Aug 2017 10:58:58 -0400 Subject: Make comment easier to read. --- completions/bash/brew | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/bash/brew b/completions/bash/brew index ac1fd3e4f..60c272f73 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -563,7 +563,7 @@ _brew() { if [[ "$i" -eq "$COMP_CWORD" ]] then - # Do not auto-complete "*instal" abbreviations for "*install" commands. + # Do not auto-complete "*instal" or "*uninstal" aliases for "*install" commands. # Prefix newline to prevent not checking the first command. local cmds=$'\n'"$(brew commands --quiet --include-aliases | grep -v instal$)" __brewcomp "${cmds}" -- cgit v1.2.3