title: click module autocomplete does not work at a depth of 3 groups
body: <p><a href="https://pypi.python.org/pypi/click" rel="nofollow noreferrer"><code>click</code></a> is a Python package for creating command line interfaces.</p>
  
  <p>I have this command structure.</p>
  
  <pre><code>cli        (group - entry point)
  -ip        (group)
  --static   (group)
  ---foo     (method)
  --floating (group)
  ---bar     (method)
  </code></pre>
  
  <p>And when I press <kbd><code>Tab</code></kbd><kbd><code>Tab</code></kbd> keys:</p>
  
  <ol>
  <li>attempt - i have correct autocomplete such as <code>ip</code> command</li>
  <li>attempt - i have correct autocomplete such as <code>floating</code> and <code>static</code> commands</li>
  <li>attempt - i have <strong>incorrect</strong> autocomplete - list of all files in current dir instead of <code>bar</code> command.</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/Qasi3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qasi3.png" alt="screenshot"></a></p>
  
  <p>Here's the code:
  <strong>setup.py</strong></p>
  
  <pre><code>from distutils.core import setup
  
  setup(
      name='sampleclick',
      packages=['sampleclick'],
      entry_points={
          'console_scripts': [
              'sc = sampleclick.shell:cli'
          ]
      },
      install_requires=[
          'click&gt;=6.6',
      ]
  )
  </code></pre>
  
  <p><strong>shell.py</strong></p>
  
  <pre><code># coding=utf-8
  import click
  
  
  @click.group()
  def cli():
      """Entry point"""
  
  
  @cli.group()
  def ip():
      pass
  
  
  @ip.group()
  def floating():
      pass
  
  
  @floating.command()
  def bar():
      """Is a ip floating command"""
  
  
  @ip.group()
  def static():
      pass
  
  
  @static.command()
  def foo():
      """Is a ip static command"""
  </code></pre>
  
  <p>How do I fix this?</p>