show total hostmasks searched in !maskfind output
This commit is contained in:
parent
c526322bc0
commit
c19d20dec2
1 changed files with 5 additions and 2 deletions
|
@ -24,13 +24,16 @@ class Module(ModuleManager.BaseModule):
|
||||||
hostmask_str = event["args_split"][0]
|
hostmask_str = event["args_split"][0]
|
||||||
hostmask = utils.irc.hostmask_parse(hostmask_str)
|
hostmask = utils.irc.hostmask_parse(hostmask_str)
|
||||||
|
|
||||||
|
searched = 0
|
||||||
for nickname, userhosts in all_userhosts:
|
for nickname, userhosts in all_userhosts:
|
||||||
|
searched += len(userhosts)
|
||||||
for userhost in userhosts:
|
for userhost in userhosts:
|
||||||
if hostmask.match(userhost):
|
if hostmask.match(userhost):
|
||||||
nicknames.add(nickname)
|
nicknames.add(nickname)
|
||||||
|
|
||||||
if nicknames:
|
if nicknames:
|
||||||
event["stdout"].write("%s (%d): %s" %
|
event["stdout"].write("%s (%d/%d): %s" %
|
||||||
(hostmask_str, len(nicknames), ", ".join(sorted(nicknames))))
|
(hostmask_str, len(nicknames), searched,
|
||||||
|
", ".join(sorted(nicknames))))
|
||||||
else:
|
else:
|
||||||
event["stderr"].write("Hostmask not found")
|
event["stderr"].write("Hostmask not found")
|
||||||
|
|
Loading…
Reference in a new issue