aboutsummaryrefslogtreecommitdiffstats
path: root/qtip/cli/entry.py
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-05-13 11:15:49 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-05-15 15:16:10 +0000
commit426ad7b517f20ff8c77ed69dcd056db7d5278f18 (patch)
tree57518b7531da0ebfa6ea6436ea14c91d947abf6c /qtip/cli/entry.py
parent284cc6fe24375ad6d32cc567d0c64eedc1a4f4b7 (diff)
Refactoring workspace related commands to `project` group
- renamed `workspace` to `project`, which is more accurate - group create/setup/run/teardown into `project` - shortcut for project commands, e.g. `qtip create` <=> `qtip project create` - even shorter command alias, e.g. `qtip s` => `qtip setup` Change-Id: I69ba5aa571bccc1cc4687481189c329b099bee91 Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'qtip/cli/entry.py')
-rw-r--r--qtip/cli/entry.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/qtip/cli/entry.py b/qtip/cli/entry.py
index b84a03d0..b557047d 100644
--- a/qtip/cli/entry.py
+++ b/qtip/cli/entry.py
@@ -12,6 +12,7 @@ import os
import pkg_resources as pkg
import sys
+from qtip.cli.commands.cmd_project import cli as project_commands
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@@ -28,7 +29,7 @@ cmd_folder = os.path.abspath(os.path.join(os.path.dirname(__file__),
'commands'))
-class QtipCli(click.MultiCommand):
+class SubCommand(click.MultiCommand):
def list_commands(self, ctx):
rv = []
@@ -50,7 +51,15 @@ class QtipCli(click.MultiCommand):
return mod.cli
-@click.command(cls=QtipCli, context_settings=CONTEXT_SETTINGS,
+@click.command(cls=SubCommand, context_settings=CONTEXT_SETTINGS,
+ invoke_without_command=True)
+def sub_commands(ctx, verbose, debug):
+ pass
+
+
+@click.command(cls=click.CommandCollection,
+ help="Platform performance benchmarking",
+ sources=[sub_commands, project_commands],
invoke_without_command=True)
@click.option('-v', '--verbose', is_flag=True, help='Enable verbose mode.')
@click.option('-d', '--debug', is_flag=True, help='Enable debug mode.')