aboutsummaryrefslogtreecommitdiffstats
path: root/cli/cli_base.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-05-03 09:56:22 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-05-03 09:56:22 +0000
commit7ad2ce42a2bc2c8dc17fbc9423da71a95fed4d87 (patch)
tree0a320a3c0fa35098fe9e71be51b42b2d9845a2ad /cli/cli_base.py
parentfa36ceb257c34874fa9169ee5757ec16c8207df6 (diff)
parent78680224ed5d400c9ab0d1a92c01d457f5686ea8 (diff)
Merge "Create CLI template for Functest"
Diffstat (limited to 'cli/cli_base.py')
-rw-r--r--cli/cli_base.py104
1 files changed, 104 insertions, 0 deletions
diff --git a/cli/cli_base.py b/cli/cli_base.py
new file mode 100644
index 000000000..e8c1d194a
--- /dev/null
+++ b/cli/cli_base.py
@@ -0,0 +1,104 @@
+import click
+
+from functest.cli.commands.cli_env import CliEnv
+from functest.cli.commands.cli_testcase import CliTestcase
+from functest.cli.commands.cli_tier import CliTier
+
+CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
+
+
+@click.group(context_settings=CONTEXT_SETTINGS)
+@click.version_option(version='opnfv colorado.0.1 ')
+def cli():
+ pass
+
+_env = CliEnv()
+_testcase = CliTestcase()
+_tier = CliTier()
+
+
+@cli.group()
+@click.pass_context
+def env(ctx):
+ pass
+
+
+@cli.group()
+@click.pass_context
+def testcase(ctx):
+ pass
+
+
+@cli.group()
+@click.pass_context
+def tier(ctx):
+ pass
+
+
+@env.command('show', help="write the help here")
+def env_show():
+ _env.show()
+
+
+@env.command('status', help="write the help here")
+def env_status():
+ _env.status()
+
+
+@env.command('getrc', help="write the help here")
+def env_getrc():
+ _env.getrc()
+
+
+@env.command('sourcerc', help="write the help here")
+def env_sourcerc():
+ _env.sourcerc()
+
+
+@env.command('setdefaults', help="write the help here")
+def env_setdefaults():
+ _env.setdefaults()
+
+
+@env.command('getdefaults', help="write the help here")
+def env_getdefaults():
+ _env.getdefaults()
+
+
+@env.command('clean', help="write the help here")
+def env_clean():
+ _env.clean()
+
+
+@testcase.command('list', help="write the help here")
+def testcase_list():
+ _testcase.list()
+
+
+@testcase.command('show', help="write the help here")
+@click.argument('testname', type=click.STRING, required=True)
+def testcase_show(testname):
+ _testcase.show(testname)
+
+
+@testcase.command('run', help="write the help here")
+@click.argument('testname', type=click.STRING, required=True)
+def testcase_run(testname):
+ _testcase.run(testname)
+
+
+@tier.command('list', help="write the help here")
+def tier_list():
+ _tier.list()
+
+
+@tier.command('show', help="write the help here")
+@click.argument('tiername', type=click.STRING, required=True)
+def tier_show(tiername):
+ _tier.show(tiername)
+
+
+@tier.command('run', help="write the help here")
+@click.argument('tiername', type=click.STRING, required=True)
+def tier_run(tiername):
+ _tier.run(tiername)