display transport arguments in pupygen -l

This commit is contained in:
n1nj4sec 2016-06-04 01:52:23 +02:00
parent 878ff47208
commit 4e92127280
2 changed files with 12 additions and 6 deletions

View File

@ -199,8 +199,13 @@ class ListOptions(argparse.Action):
print "" print ""
print colorize("## available transports :","green") print colorize("## available transports :","green")
for name, dic in transports.iteritems(): for name, dic in transports.iteritems():
print "\t- {:<20} : {}".format(name, dic["info"]) print "\t- {}".format(name,)
print "" print "\t {:<15} : {}".format("description", dic["info"])
arguments=','.join([x for x in dic["client_kwargs"].iterkeys()])+','.join([x for x in dic["client_transport_kwargs"].iterkeys()])
if not arguments:
arguments = "none"
print "\t {:<15} : {}".format("arguments" ,arguments)
print colorize("## available scriptlets :", "green") print colorize("## available scriptlets :", "green")
scriptlets_dic=load_scriptlets() scriptlets_dic=load_scriptlets()
for name, sc in scriptlets_dic.iteritems(): for name, sc in scriptlets_dic.iteritems():

View File

@ -24,13 +24,14 @@ class Scriptlet(object):
@classmethod @classmethod
def get_help(cls): def get_help(cls):
res=("\tdescription: %s\n"%cls.__doc__) res=("\tdescription : %s\n"%cls.__doc__)
if cls.arguments: if cls.arguments:
res+=("\targuments: \n") res+=("\targuments : \n")
for arg, desc in cls.arguments.iteritems(): for arg, desc in cls.arguments.iteritems():
res+="\t\t- {:<10} : {}\n".format(arg, desc) res+="\t\t\t{:<10} : {}\n".format(arg, desc)
else: else:
res+=("\targuments: this scriptlet does not take any argument\n") res+=("\targuments : \n")
res+="\t\t\t{:<10}\n".format("no arguments")
return res return res
ROOT=os.path.abspath(os.path.join(os.path.dirname(__file__),"..","packages")) ROOT=os.path.abspath(os.path.join(os.path.dirname(__file__),"..","packages"))