Skip to content

Instantly share code, notes, and snippets.

@Robert-96
Last active January 17, 2020 13:05
Show Gist options
  • Save Robert-96/f0e247fd75eeff12ccdc2645106a22d7 to your computer and use it in GitHub Desktop.
Save Robert-96/f0e247fd75eeff12ccdc2645106a22d7 to your computer and use it in GitHub Desktop.
Click version option with `--version` and `-v`
import click
# the version number to show. If None Click attempts an auto discovery via setuptools.
VERSION = "0.1"
@click.group()
@click.version_option(VERSION, "-v", "--version")
def cli():
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment