mirror of https://github.com/n1nj4sec/pupy.git
fix help display + probably fix issue #60
This commit is contained in:
parent
8a8510c856
commit
29d50178d9
|
@ -300,7 +300,7 @@ class PupyCmd(cmd.Cmd):
|
||||||
try:
|
try:
|
||||||
doc=getattr(self, 'do_' + arg).__doc__
|
doc=getattr(self, 'do_' + arg).__doc__
|
||||||
if doc:
|
if doc:
|
||||||
self.stdout.write("%s\n"%str(doc))
|
self.stdout.write("%s\n"%str(doc).strip())
|
||||||
return
|
return
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
@ -327,7 +327,7 @@ class PupyCmd(cmd.Cmd):
|
||||||
cmds_doc.append(cmd)
|
cmds_doc.append(cmd)
|
||||||
del help[cmd]
|
del help[cmd]
|
||||||
elif getattr(self, name).__doc__:
|
elif getattr(self, name).__doc__:
|
||||||
cmds_doc.append((cmd, getattr(self, name).__doc__))
|
cmds_doc.append((cmd, getattr(self, name).__doc__.strip()))
|
||||||
else:
|
else:
|
||||||
cmds_doc.append((cmd, ""))
|
cmds_doc.append((cmd, ""))
|
||||||
for name in [x for x in self.aliases.iterkeys()]:
|
for name in [x for x in self.aliases.iterkeys()]:
|
||||||
|
@ -335,7 +335,9 @@ class PupyCmd(cmd.Cmd):
|
||||||
|
|
||||||
self.stdout.write("%s\n"%str(self.doc_header))
|
self.stdout.write("%s\n"%str(self.doc_header))
|
||||||
for command,doc in cmds_doc:
|
for command,doc in cmds_doc:
|
||||||
self.stdout.write("- {:<10} {}\n".format(command, color(doc,'grey')))
|
if doc is None:
|
||||||
|
doc=""
|
||||||
|
self.stdout.write("- {:<10} {}\n".format(command, color(doc.strip(),'grey')))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def format_log(msg):
|
def format_log(msg):
|
||||||
|
|
|
@ -134,7 +134,15 @@ class PupyJob(object):
|
||||||
# raise RuntimeError("job %s has already been started !"%str(self))
|
# raise RuntimeError("job %s has already been started !"%str(self))
|
||||||
for m in self.pupymodules:
|
for m in self.pupymodules:
|
||||||
margs=m.arg_parser.parse_args(args)
|
margs=m.arg_parser.parse_args(args)
|
||||||
comp, comp_exp= m.is_compatible()
|
res = m.is_compatible()
|
||||||
|
if type(res) is tuple:
|
||||||
|
comp, comp_exp=res
|
||||||
|
elif res is None:
|
||||||
|
comp=True
|
||||||
|
comp_exp=""
|
||||||
|
else:
|
||||||
|
comp=res
|
||||||
|
comp_exp="reason not precised"
|
||||||
if not comp:
|
if not comp:
|
||||||
m.error("Compatibility error : %s"%comp_exp)
|
m.error("Compatibility error : %s"%comp_exp)
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue