diff --git a/bench/commands/__init__.py b/bench/commands/__init__.py index 60861e63..a1f7f450 100644 --- a/bench/commands/__init__.py +++ b/bench/commands/__init__.py @@ -1,8 +1,18 @@ import click +def print_bench_version(ctx, param, value): + """Prints current bench version""" + if not value or ctx.resilient_parsing: + return + + import bench + click.echo(bench.__version__) + ctx.exit() + @click.group() +@click.option('--version', is_flag=True, is_eager=True, callback=print_bench_version, expose_value=False) def bench_command(bench_path='.'): - "Bench manager for Frappe" + """Bench manager for Frappe""" import bench from bench.app import get_current_frappe_version from bench.utils import setup_logging