Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the option --version to verdi to display current version #1811

Merged
merged 1 commit into from
Jul 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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