Skip to content

Commit

Permalink
Add commandline option to ask for version
Browse files Browse the repository at this point in the history
  • Loading branch information
berndbohmeier committed Aug 7, 2018
1 parent 70dde0e commit 7c8b01a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tlcontracts/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import click
import json
import pkg_resources

from eth_utils import is_checksum_address, to_checksum_address

Expand All @@ -11,10 +12,16 @@
from tlcontracts.configurable_chain import ConfigurableChain


@click.group()
def cli():
@click.group(invoke_without_command=True)
@click.option('--version', help='Prints the version of the software', is_flag=True)
@click.pass_context
def cli(ctx, version):
"""Commandline tool to deploy the Trustlines contracts"""
pass
if version:
click.echo(pkg_resources.get_distribution('trustlines-contracts').version)
elif ctx.invoked_subcommand is None:
click.echo(ctx.get_help())
ctx.exit()


jsonrpc_option = click.option('--jsonrpc',
Expand Down

0 comments on commit 7c8b01a

Please sign in to comment.