summaryrefslogtreecommitdiffstats
path: root/cli/cli_base.py
blob: e8c1d194a4289245e3b0ae972f6a4dda93c22999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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)