From 55fc728baf4f1f8f6c94a833ed251962fa8cfd04 Mon Sep 17 00:00:00 2001 From: Poruri Sai Rahul Date: Tue, 1 Dec 2020 08:51:34 +0000 Subject: [PATCH] Make improvements to edmtool (#454) * DEV : edmtool improvements - ensure that -h works along with --help - add a new shell command modified: ci/edmtool.py * CLN : Use a dict literal instead of dict function modified: ci/edmtool.py --- ci/edmtool.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 779fc887b..866d58762 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -152,7 +152,13 @@ github_url_fmt = "git+http://github.com/enthought/{0}.git#egg={0}" -@click.group() +# Ensure that "-h" is supported for getting help. +CONTEXT_SETTINGS = { + "help_option_names": ["-h", "--help"], +} + + +@click.group(context_settings=CONTEXT_SETTINGS) def cli(): pass @@ -234,6 +240,23 @@ def install(runtime, toolkit, pillow, environment, source): click.echo('Done install') +@cli.command() +@click.option('--runtime', default='3.6') +@click.option('--toolkit', default='null') +@click.option('--pillow', default='pillow') +@click.option('--environment', default=None) +def shell(runtime, toolkit, pillow, environment): + """ Create a shell into the EDM development environment + (aka 'activate' it). + + """ + parameters = get_parameters(runtime, toolkit, pillow, environment) + commands = [ + "edm shell -e {environment}", + ] + execute(commands, parameters) + + @cli.command() @click.option('--runtime', default='3.6') @click.option('--toolkit', default='null')