title: With python click, how can I avoid duplicating argument code used by multiple subcommands
body: <p>I have a group of subcommands that all operate on a list of URLs that can optionally be passed as an argument. How can I assign this argument to the group instead to avoid duplicating the argument definition on every subcommand?</p>
  
  <p>Current code:</p>
  
  <pre><code>from config import site_list
  
  @click.group()
  def cli():
      pass
  
  @cli.command()
  @cli.argument('sites', nargs=-1)
  def subcommand_one():
      if sites:
          site_list = sites
      etc...
  
  @cli.command()
  @cli.argument('sites', nargs=-1)
  def subcommand_two():
      if sites:
          site_list = sites
      etc...
  </code></pre>
  
  <p>Example invocation:</p>
  
  <pre><code>$ python sites.py subcommand_one www.example.com www.example2.com
  </code></pre>
  
  <p>I tried moving the argument decorator to the group like this:</p>
  
  <pre><code>@click.group()
  @click.argument('sites', nargs=-1)
  def cli(sites):
      if sites:
          site_list = sites
  </code></pre>
  
  <p>But then I would get this error: </p>
  
  <pre><code>$ python sites.py subcommand_one
  Usage: sites.py [OPTIONS] [SITES] COMMAND [ARGS]...
  Try "sites.py --help" for help.
  
  Error: Missing command.
  </code></pre>