title: Python multi-command CLI with common options
body: <p>I am adding CLI for my Python application. The CLI should allow to run multiple commands in a time. The commands should have common options and personal options.</p>
  
  <p><em>Example</em>:</p>
  
  <pre><code>$ python mycliapp.py --common-option1 value1 --common-option2 value2 cmd1 --cmd1-option cmd2 --cmd2-option somevalue cmd3
  </code></pre>
  
  <p>The example has two common options used by all commands and each command can have or not the option used by the command only.</p>
  
  <p>I have considered Python Click. It has rich functionality, but it does not allow (at least I didn't found) to use common options without some main command.</p>
  
  <p><em>The above example will look as follows with Click</em>:</p>
  
  <pre><code>$ python mycliapp.py maincmd --common-option1 value1 --common-option2 value2 cmd1 --cmd1-option cmd2 --cmd2-option somevalue cmd3
  </code></pre>
  
  <p>Also, considered Python Argparse. It looks that it can do what I need and I have managed to write a code, which works with common options and single command, but cannot manage to use multiple commands.
  This page <a href="https://stackoverflow.com/questions/7498595/python-argparse-add-argument-to-multiple-subparsers">Python argparse - Add argument to multiple subparsers</a> has good example, but seems that command2 should be a sub-command of command1. It is a bit different since I need that the commands can be executed in any order.</p>