Skip to content

Commit

Permalink
Add the option --version to verdi to display current version (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
sphuber authored Jul 28, 2018
1 parent 1dfd4a8 commit 9eb94f2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions aiida/cmdline/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,20 @@
click_completion.init()


@click.group()
@click.option('-p', '--profile', help='Execute the command for this profile instead of the default profile')
@click.group(invoke_without_command=True)
@click.option('-p', '--profile', help='Execute the command for this profile instead of the default profile.')
@click.option('--version', is_flag=True, default=False, help='Print the version of AiiDA that is currently installed.')
@click.pass_context
def verdi(ctx, profile):
def verdi(ctx, profile, version):
"""The command line interface of AiiDA."""
import sys
import aiida
from aiida.cmdline.utils import echo

if version:
echo.echo('AiiDA version {}'.format(aiida.__version__))
sys.exit(0)

if profile is not None:
from aiida.backends import settings
settings.AIIDADB_PROFILE = profile
Expand Down

0 comments on commit 9eb94f2

Please sign in to comment.