title: Merge arguments and options of multiple Click commands under a single CLI command
body: <p>Is there a way to group multiple commands, each with their own different parameters under a single function.</p>
  
  <p>At first glance, a <code>MultiCommand</code> or <code>Group</code> might seem like a natural way of doing what I'd like, i.e. have a single main command act as the <code>Group</code> (and pass the <code>invoke_without_command=True</code> flag) then nest auxiliary <code>Command</code>s beneath it as subcommands. However this doesn't quite have the behavior that I'd want, since I'd like all the options from all commands to be able to be specified without explicitly invoking a subcommand. Additionally, using a <code>Group</code> would also not display the help text of the subcommands without invoking the subcommand on the command line as well.</p>
  
  <p>I guess what I'd ideally like to have is a way to group multiple commands together without the nesting inherent to Click's <code>Group</code> API.</p>
  
  <p>Sorry if this question might be somewhat general. Any help, ideas or tips that can point me in the right direction would be much appreciated.</p>
  
  <p>Here's an outline of what I'd like (file name: <code>cli_test.py</code>):</p>
  
  <pre class="lang-py prettyprint-override"><code>import click
  
  
  @click.command()
  @click.option('--db-file', type=click.File(mode='r'))
  def db_reader(db_file):
      click.echo(db_file)
  
  
  @click.command()
  @click.option('--xval', type=float)
  @click.option('--yval', type=float)
  def get_vals(xval, yval):
      return xval, yval
  
  
  @click.command()
  @click.option('--absolutize/--no-absolutize')
  def flagger(absolutize):
      click.echo(absolutize)
  
  
  @click.command()
  def cli_runner():
      db = db_reader.main(standalone_mode=False)
      vals = flagger.main(standalone_mode=False)
      flag = flagger.main(standalone_mode=False)
  
  
  if __name__ == '__main__':
      cli_runner()
  </code></pre>
  
  <p>Essentially, I'd like a single command that can be run on the CLI (<code>cli_runner</code> in the above example), which would be able to take the parameters of all Click commands called within it, and then dispatch the processing of them to the appropriate <code>Command</code> instance. However as it stands right now, if I were to invoke on the CLI: <code>$ python cli_test.py --xval 4</code> I'd get the error <code>Error: no such option: --xval</code>. I have also tried playing around with the <code>pass_context</code> and then <code>ctx.invoke()</code> approach, but the same problem exists.</p>
  
  <p>I suppose I could pass parameters from all contained commands into <code>cli_runner</code>, but that would defeat the purpose of what I want to do, which is to ultimately have 3-4 modular "subcommands", that can then be grouped together in different combinations into larger interfaces that serve slightly different use cases.</p>