-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd_args.py
28 lines (24 loc) · 1.08 KB
/
cmd_args.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
import argparse
import os
class CMD:
def __init__(self) -> None:
try:
arg = argparse.ArgumentParser()
general_args = arg.add_argument_group(title='Configuration', description='General options')
general_args.add_argument('-ip',
type=str,
required=True,
help="Set server IP")
general_args.add_argument('-port',
type=int,
required=True,
help="Set server port")
general_args.add_argument('-whitelist',
type=str,
default='',
required=False,
help="Set file with whitelisted IPs")
self.args = arg.parse_args()
except SystemExit:
print('Command not recognized!')
os._exit(8)