Skip to content
Snippets Groups Projects
Commit 8b8bf793 authored by Adam Vandenberg's avatar Adam Vandenberg
Browse files

Some people alias 'ls' so escape it in bash completion

parent 20e2844d
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ _brew_to_completion()
local actions="--cache --config --prefix cat cleanup configure create
deps doctor edit home info install link list log outdated prune
remove search unlink update uses"
local ext=$(ls $(brew --repository)/Library/Contributions/examples |
local ext=$(\ls $(brew --repository)/Library/Contributions/examples |
sed -e "s/\.rb//g" -e "s/brew-//g")
COMPREPLY=( $(compgen -W "${actions} ${ext}" -- ${cur}) )
return
......@@ -29,14 +29,14 @@ _brew_to_completion()
case "$prev" in
# Commands that take a formula
cat|deps|edit|fetch|home|homepage|info|install|log|options|uses)
local ff=$(ls $(brew --repository)/Library/Formula | sed "s/\.rb//g")
local af=$(ls $(brew --repository)/Library/Aliases 2> /dev/null | sed "s/\.rb//g")
local ff=$(\ls $(brew --repository)/Library/Formula | sed "s/\.rb//g")
local af=$(\ls $(brew --repository)/Library/Aliases 2> /dev/null | sed "s/\.rb//g")
COMPREPLY=( $(compgen -W "${ff} ${af}" -- ${cur}) )
return
;;
# Commands that take an existing brew
abv|cleanup|link|list|ln|ls|remove|rm|uninstall|unlink)
COMPREPLY=( $(compgen -W "$(ls $(brew --cellar))" -- ${cur}) )
COMPREPLY=( $(compgen -W "$(\ls $(brew --cellar))" -- ${cur}) )
return
;;
esac
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment