title: How to write entry_points argument for multiple Click CLI functions?
body: <p>I'm trying to configure setuptools and Click module for multiple functions. </p>
  
  <p>Click documentation instructs in <a href="http://click.pocoo.org/5/quickstart/#nesting-commands" rel="nofollow noreferrer">Nesting Commands</a> section to use <code>click.group()</code>. </p>
  
  <p>How do you write the entry_points for multiple CLick CLI functions? </p>
  
  <p>I was toying with they syntax, and I managed to get something working but I can't recreate it. I was something like this,</p>
  
  <pre><code>entry_points='''
      [console_scripts]
      somefunc=yourscript:somefunc
      morefunc=yourscript:morefunc
  '''
  </code></pre>
  
  <p>Following the sample given below, I converted the syntax to a dictionary:</p>
  
  <pre><code>entry_points= {'console_scripts': 
          ['somefunc = yourscript:somefunc',
          'morefunc = yourscript:morefunc'
      ]},
  </code></pre>
  
  <p>After I reinstalled, calling the script raised this error:</p>
  
  <pre><code>(clickenv) &gt; somefunc          
  Traceback (most recent call last):
  [...]
      raise TypeError('Attempted to convert a callback into a '
  TypeError: Attempted to convert a callback into a command twice.
  </code></pre>
  
  <hr>
  
  <p>The way I made this work the first time, was I installed the script, and then gradually changed the code through the various examples. At one point, just as described in the docs, I called the script with <code>$ yourscript somefunc</code>. However, when I recreated the pattern in my project I got that error. </p>
  
  <p>Here I've uninstalled and reinstalled (even though its advertised as unnecessary, <code>pip install -e .</code>) and removed the second entrypoint. Here's my testing example. The function <code>morefunc</code> requires a .txt input file.</p>
  
  <pre><code># yourscript.py
  import click
  
  @click.command()
  @click.group()
  def cli():
      pass
  
  @cli.command()
  def somefunc():
      click.echo('Hello World!')
  
  @cli.command()
  @click.argument('input', type=click.File('rb'))
  @click.option('--saveas', default='HelloWorld.txt', type=click.File('wb'))
  def morefunc(input, saveas):
      while True:
          chunk = input.read(1024)
          if not chunk:
              break
          saveas.write(chunk)
  
  # setup.py
  from setuptools import setup
  setup(
      name='ClickCLITest',
      version='0.1',
      py_modules=['yourscript'],
      install_requires=[
          'Click',
      ],
      entry_points= {'console_scripts': 
              ['somefunc = yourscript:somefunc']},
   )
  </code></pre>