-
Notifications
You must be signed in to change notification settings - Fork 265
Expand file tree
/
Copy pathtos.py
More file actions
executable file
·61 lines (52 loc) · 1.71 KB
/
tos.py
File metadata and controls
executable file
·61 lines (52 loc) · 1.71 KB
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
#!/usr/bin/env python3
# coding=utf-8
import click
import logging
from click_completion import init as click_completion_init
from tools.cli_command.util import (
set_clis, set_logger, set_global_params
)
from tools.cli_command.cli_version import cli as version_exec
from tools.cli_command.cli_check import cli as check_exec
from tools.cli_command.cli_config import cli as config_exec
from tools.cli_command.cli_build import cli as build_exec
from tools.cli_command.cli_clean import cli as clean_exec
from tools.cli_command.cli_flash import cli as flash_exec
from tools.cli_command.cli_monitor import cli as monitor_exec
from tools.cli_command.cli_update import cli as update_exec
from tools.cli_command.cli_new import cli as new_exec
from tools.cli_command.cli_dev import cli as dev_exec
from tools.cli_command.cli_idf import cli as idf_exec
from tools.cli_command.cli_hello import cli as hello_exec
click_completion_init()
CLIS = {
"version": version_exec,
"check": check_exec,
"config": config_exec,
"build": build_exec,
"clean": clean_exec,
"flash": flash_exec,
"monitor": monitor_exec,
"update": update_exec,
"new": new_exec,
"dev": dev_exec,
"idf": idf_exec,
"hello": hello_exec,
}
@click.command(cls=set_clis(CLIS),
help="Tuya Uart Tool.",
context_settings=dict(help_option_names=["-h", "--help"]))
@click.option('-d', '--debug',
is_flag=True, default=False,
help="Show debug message")
def run(debug):
log_level = logging.INFO
if debug:
log_level = logging.DEBUG
logger = set_logger(log_level)
set_global_params()
logger.info("Running tos.py ...")
pass
if __name__ == '__main__':
run()
pass