From b726c77189753138a321d8d8aba4dfb5cc3ed7d1 Mon Sep 17 00:00:00 2001 From: Dave Goodell Date: Fri, 1 Mar 2013 22:54:13 -0600 Subject: git: add `--without-completions` option Some users prefer the `_git` script included with the zsh distribution instead of the one based on the bash completion script. References #16992. Closes #18180. Signed-off-by: Mike McQuaid --- Library/Formula/git.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Library/Formula/git.rb') diff --git a/Library/Formula/git.rb b/Library/Formula/git.rb index 2818a3009..e58027913 100644 --- a/Library/Formula/git.rb +++ b/Library/Formula/git.rb @@ -18,6 +18,7 @@ class Git < Formula head 'https://github.com/git/git.git' option 'with-blk-sha1', 'Compile with the block-optimized SHA1 implementation' + option 'without-completions', 'Disable bash/zsh completions from "contrib" directory' depends_on 'pcre' => :optional @@ -64,12 +65,14 @@ class Git < Formula bin.install 'git-subtree' end - # install the completion script first because it is inside 'contrib' - bash_completion.install 'contrib/completion/git-completion.bash' - bash_completion.install 'contrib/completion/git-prompt.sh' + unless build.include? 'without-completions' + # install the completion script first because it is inside 'contrib' + bash_completion.install 'contrib/completion/git-completion.bash' + bash_completion.install 'contrib/completion/git-prompt.sh' - zsh_completion.install 'contrib/completion/git-completion.zsh' => '_git' - cp "#{bash_completion}/git-completion.bash", zsh_completion + zsh_completion.install 'contrib/completion/git-completion.zsh' => '_git' + cp "#{bash_completion}/git-completion.bash", zsh_completion + end (share+'git-core').install 'contrib' -- cgit v1.2.3