title: How to implement --version using python click?
body: <p>I want to implement <code>mycommand --version</code> using python click. I have something like this working but it feels kinda clunky.</p>
  
  <pre><code>@click.group(invoke_without_command=True, no_args_is_help=True)
  @click.pass_context
  @click.option('--version', 'version')
  def cli(ctx, version):
      if version:
          ctx.echo(f'{sys.argv[0]} {__version__}')
          ctx.exit()
  </code></pre>