-
Notifications
You must be signed in to change notification settings - Fork 135
/
main.py
49 lines (44 loc) · 1.94 KB
/
main.py
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
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# ------------------------------------------------------------
# File: main.py
# Created Date: 2020/6/24
# Created Time: 0:16
# Author: Hypdncy
# Author Mail: [email protected]
# Copyright (c) 2020 Hypdncy
# ------------------------------------------------------------
# .::::.
# .::::::::.
# :::::::::::
# ..:::::::::::'
# '::::::::::::'
# .::::::::::
# '::::::::::::::..
# ..::::::::::::.
# ``::::::::::::::::
# ::::``:::::::::' .:::.
# ::::' ':::::' .::::::::.
# .::::' :::: .:::::::'::::.
# .:::' ::::: .:::::::::' ':::::.
# .::' :::::.:::::::::' ':::::.
# .::' ::::::::::::::' ``::::.
# ...::: ::::::::::::' ``::.
# ````':. ':::::::::' ::::..
# '.:::::' ':'````..
# ------------------------------------------------------------
import argparse
import logging
from modle.handle import Handle
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
parser = argparse.ArgumentParser(description="自动化报告生成程序,用于生成主机扫描的报告文档")
parser.add_argument("-t", "--type", dest="docxtype", type=str, action="store", default="loops",
choices=["loops", "hosts", "host", "all"],
help="配置文档生成方式")
parser.add_argument("-e", "--excel", dest="exceltype", type=str, action="store", default="true",
choices=["true", "false"],
help="配置是否生成excel")
args = parser.parse_args()
h = Handle(args.docxtype, args.exceltype)
h.run()