[man] Dusting + fill help

This commit is contained in:
nemunaire 2015-12-03 00:29:16 +01:00
parent 313c693d48
commit 009ab08821

View File

@ -1,6 +1,6 @@
# coding=utf-8 """Read manual pages on IRC"""
"Read manual pages on IRC" # PYTHON STUFFS #######################################################
import subprocess import subprocess
import re import re
@ -8,18 +8,22 @@ import os
from nemubot.hooks import hook from nemubot.hooks import hook
nemubotversion = 3.4
from more import Response from more import Response
def help_full(): # GLOBALS #############################################################
return "!man [0-9] /what/: gives informations about /what/."
RGXP_s = re.compile(b'\x1b\\[[0-9]+m') RGXP_s = re.compile(b'\x1b\\[[0-9]+m')
@hook.command("MAN") # MODULE INTERFACE ####################################################
@hook.command("MAN",
help="Show man pages",
help_usage={
"SUBJECT": "Display the default man page for SUBJECT",
"SECTION SUBJECT": "Display the man page in SECTION for SUBJECT"
})
def cmd_man(msg): def cmd_man(msg):
args = ["man"] args = ["man"]
num = None num = None
@ -52,7 +56,11 @@ def cmd_man(msg):
return res return res
@hook.command("man") @hook.command("man",
help="Show man pages synopsis (in one line)",
help_usage={
"SUBJECT": "Display man page synopsis for SUBJECT",
})
def cmd_whatis(msg): def cmd_whatis(msg):
args = ["whatis", " ".join(msg.args)] args = ["whatis", " ".join(msg.args)]