Skip to content

Commit

Permalink
Fix bash-completion for git 1.7.2.
Browse files Browse the repository at this point in the history
The completion for git 1.7.2 parses the output of `git help --all`
to generate a list of available commands. The output from `hub help`
does not conform to the same format or respect the `--all` flag.

To fix this issue, we only display hub's extended help when the
`--all` (or `-a`) flag is not present, falling back to git.
  • Loading branch information
mkhl authored and defunkt committed Aug 9, 2010
1 parent af33b54 commit 332357e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hub/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def help(args)
if command == 'hub'
puts hub_manpage
exit
elsif command.nil?
elsif command.nil? && args.grep(/^--?a/).empty?
ENV['GIT_PAGER'] = '' if args.grep(/^-{1,2}p/).empty? # Use `cat`.
puts improved_help_text
exit
Expand Down

0 comments on commit 332357e

Please sign in to comment.