##// END OF EJS Templates
help: refactor filtercmd
timeless -
r27323:0fe93498 default
parent child Browse files
Show More
@@ -84,6 +84,13 b' def indicateomitted(rst, omitted, notomi'
84 if notomitted:
84 if notomitted:
85 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
85 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
86
86
87 def filtercmd(ui, cmd, kw, doc):
88 if not ui.debugflag and cmd.startswith("debug") and kw != "debug":
89 return True
90 if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
91 return True
92 return False
93
87 def topicmatch(ui, kw):
94 def topicmatch(ui, kw):
88 """Return help topics matching kw.
95 """Return help topics matching kw.
89
96
@@ -340,10 +347,8 b' def help_(ui, name, unknowncmd=False, fu'
340 if name == "shortlist" and not f.startswith("^"):
347 if name == "shortlist" and not f.startswith("^"):
341 continue
348 continue
342 f = f.lstrip("^")
349 f = f.lstrip("^")
343 if not ui.debugflag and f.startswith("debug") and name != "debug":
344 continue
345 doc = e[0].__doc__
350 doc = e[0].__doc__
346 if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
351 if filtercmd(ui, f, name, doc):
347 continue
352 continue
348 doc = gettext(doc)
353 doc = gettext(doc)
349 if not doc:
354 if not doc:
General Comments 0
You need to be logged in to leave comments. Login now