fix mujson_mgr & add -f
This commit is contained in:
parent
9e64d1837c
commit
268f6e23b4
1 changed files with 6 additions and 2 deletions
|
@ -149,7 +149,7 @@ General options:
|
||||||
''')
|
''')
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
shortopts = 'hadeclu:p:k:O:o:m:t'
|
shortopts = 'adeclu:p:k:O:o:m:t:f:h'
|
||||||
longopts = ['help']
|
longopts = ['help']
|
||||||
action = None
|
action = None
|
||||||
user = {}
|
user = {}
|
||||||
|
@ -178,6 +178,8 @@ def main():
|
||||||
user['protocal'] = value
|
user['protocal'] = value
|
||||||
elif key == '-m':
|
elif key == '-m':
|
||||||
user['method'] = value
|
user['method'] = value
|
||||||
|
elif key == '-f':
|
||||||
|
user['forbidden_port'] = value
|
||||||
elif key == '-t':
|
elif key == '-t':
|
||||||
val = float(value)
|
val = float(value)
|
||||||
try:
|
try:
|
||||||
|
@ -196,10 +198,12 @@ def main():
|
||||||
if action == 0:
|
if action == 0:
|
||||||
manage.clear_ud(user)
|
manage.clear_ud(user)
|
||||||
elif action == 1:
|
elif action == 1:
|
||||||
|
if 'user' not in user and 'port' in user:
|
||||||
|
user['user'] = str(user['port'])
|
||||||
if 'user' in user and 'port' in user:
|
if 'user' in user and 'port' in user:
|
||||||
manage.add(user)
|
manage.add(user)
|
||||||
else:
|
else:
|
||||||
print("You have to set the user name and port with -u/-p")
|
print("You have to set the port with -p")
|
||||||
elif action == 2:
|
elif action == 2:
|
||||||
if 'user' in user or 'port' in user:
|
if 'user' in user or 'port' in user:
|
||||||
manage.delete(user)
|
manage.delete(user)
|
||||||
|
|
Loading…
Add table
Reference in a new issue