-
Notifications
You must be signed in to change notification settings - Fork 13
/
support.py
25 lines (22 loc) · 996 Bytes
/
support.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
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# @author: orleven
from lib.core.env import *
from argparse import ArgumentParser
from lib.core.core import start_support
def arg_set(parser):
parser.add_argument('-lh', "--listen-host", action='store', help='Listen address', type=str)
parser.add_argument('-lp', "--listen-port", action='store', help='Listen port',type=int)
parser.add_argument('-sh', "--server-host", action='store', help='Server address', type=str)
parser.add_argument('-sp', "--server-port", action='store', help='Server port', type=int)
parser.add_argument("-d", "--debug", action='store_true', help="Run debug", default=False)
parser.add_argument("-h", "--help", action='store_true', help="Show help", default=False)
return parser
if __name__ == '__main__':
parser = ArgumentParser(add_help=False)
parser = arg_set(parser)
args = parser.parse_args()
if args.help:
parser.print_help()
else:
start_support(args)