[joker] using deep knowledge of argsparse and whitespaces fix

This commit is contained in:
Ryabin Sergey 2013-11-06 13:37:54 +04:00
parent 2835a1463d
commit 42a9939fe1
1 changed files with 13 additions and 13 deletions

View File

@ -2,25 +2,25 @@ import argparse
import sys
from joker import Joker
def arg_parse():
p = argparse.ArgumentParser(description = 'Joker cli interface')
p.add_argument('-i', '--identity', help = 'Path to identity file', default = None)
p.add_argument('-H', '--host', help = 'destination host')
p.add_argument('-p', '--port', help = 'destination port', default = 22 )
p.add_argument('-u', '--user', help = 'username', default = "root" )
p.add_argument('-P', '--password', help = 'username', default = None )
return p.parse_args()
def arg_parse():
p = argparse.ArgumentParser(description = 'Joker cli interface')
p.add_argument('-i', '--identity', help = 'Path to identity file', default = None)
p.add_argument('-H', '--host', help = 'destination host')
p.add_argument('-p', '--port', help = 'destination port', default = 22, type = int )
p.add_argument('-u', '--user', help = 'username', default = "root" )
p.add_argument('-P', '--password', help = 'username', default = None )
return p.parse_args()
def main():
args = arg_parse()
args = arg_parse()
print args
j = Joker(args.identity)
j.addNode("EntryPoint", args.host, int(args.port), args.user, args.password)
j = Joker(args.identity)
j.addNode("EntryPoint", args.host, args.port, args.user, args.password)
print j.discover()
print j.discover()
if __name__ == '__main__':
sys.exit(main())