mirror of
https://github.com/bkerler/mtkclient.git
synced 2024-11-30 19:26:56 -05:00
Optimize code for stage2 , use print_help instaed of showcommand
This commit is contained in:
parent
7beb83aa48
commit
8e4507ef52
1 changed files with 1 additions and 10 deletions
11
stage2
11
stage2
|
@ -534,15 +534,6 @@ cmds = {
|
|||
info = "MTK Stage2 client (c) B.Kerler 2021"
|
||||
|
||||
|
||||
def showcommands():
|
||||
print(info)
|
||||
print("-----------------------------------\n")
|
||||
print("Available commands are:\n")
|
||||
for cmd in cmds:
|
||||
print("%20s" % (cmd) + ":\t" + cmds[cmd])
|
||||
print()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=info)
|
||||
subparsers = parser.add_subparsers(dest="cmd",
|
||||
|
@ -614,7 +605,7 @@ def main():
|
|||
args = parser.parse_args()
|
||||
cmd = args.cmd
|
||||
if cmd not in cmds:
|
||||
showcommands()
|
||||
parser.print_help()
|
||||
exit(0)
|
||||
|
||||
if not os.path.exists("logs"):
|
||||
|
|
Loading…
Reference in a new issue