jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362410 )

Change subject: [DOC] Differentiate between generators and filters in -help
......................................................................


[DOC] Differentiate between generators and filters in -help

- also sort filter parameters

Bug: T167581
Change-Id: I7054328600292f3306b000d61151d32fa7293f08
---
M pywikibot/bot.py
M pywikibot/pagegenerators.py
2 files changed, 59 insertions(+), 51 deletions(-)

Approvals:
  Dalba: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 500fb5d..baa57ac 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -995,7 +995,9 @@
             module_name = "no_module"
 
     globalHelp = u'''
-Global arguments available for all bots:
+GLOBAL OPTIONS
+==============
+(Global arguments available for all bots)
 
 -dir:PATH         Read the bot's configuration data from directory given by
                   PATH, instead of from the default directory.
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 32c1c22..f775d54 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -66,9 +66,8 @@
 # a generator
 
 parameterHelp = """\
-
--catfilter        Filter the page generator to only yield pages in the
-                  specified category. See -cat for argument format.
+GENERATOR OPTIONS
+=================
 
 -cat              Work on all pages which are in a specific category.
                   Argument can also be given as "-cat:categoryname" or
@@ -144,37 +143,12 @@
 
                   In some cases it must be written as -logevents:"move,Usr,20"
 
--namespaces       Filter the page generator to only yield pages in the
--namespace        specified namespaces. Separate multiple namespace
--ns               numbers or names with commas.
-                  Examples:
-
-                  -ns:0,2,4
-                  -ns:Help,MediaWiki
-
-                  You may use a preleading "not" to exclude the namespace.
-                  Examples:
-                  -ns:not:2,3
-                  -ns:not:Help,File
-
-                  If used with -newpages/-random/-randomredirect,
-                  -namespace/ns must be provided before
-                  -newpages/-random/-randomredirect.
-                  If used with -recentchanges, efficiency is improved if
-                  -namespace/ns is provided before -recentchanges.
-
-                  If used with -start, -namespace/ns shall contain only one
-                  value.
-
 -interwiki        Work on the given page and all equivalent pages in other
                   languages. This can, for example, be used to fight
                   multi-site spamming.
                   Attention: this will cause the bot to modify
                   pages on several wiki sites, this is not well tested,
                   so check your edits!
-
--limit:n          When used with any other argument that specifies a set
-                  of pages, work on no more than n pages in total.
 
 -links            Work on all pages that are linked from a certain page.
                   Argument can also be given as "-links:linkingpagetitle".
@@ -225,22 +199,6 @@
                   default value is start:!
 
 -prefixindex      Work on pages commencing with a common prefix.
-
--subpage:n        Filters pages to only those that have depth n
-                  i.e. a depth of 0 filters out all pages that are subpages,
-                  and a depth of 1 filters out all pages that are subpages of
-                  subpages.
-
--titleregex       A regular expression that needs to match the article title
-                  otherwise the page won't be returned.
-                  Multiple -titleregex:regexpr can be provided and the page
-                  will be returned if title is matched by any of the regexpr
-                  provided.
-                  Case insensitive regular expressions will be used and
-                  dot matches any character.
-
--titleregexnot    Like -titleregex, but return the page only if the regular
-                  expression does not match.
 
 -transcludes      Work on all pages that use a certain template.
                   Argument can also be given as "-transcludes:Title".
@@ -315,6 +273,13 @@
                   "-pageid:pageid1,pageid2,." or "-pageid:'pageid1|pageid2|..'"
                   and supplied multiple times for multiple pages.
 
+
+FILTER OPTIONS
+==============
+
+-catfilter        Filter the page generator to only yield pages in the
+                  specified category. See -cat generator for argument format.
+
 -grep             A regular expression that needs to match the article
                   otherwise the page won't be returned.
                   Multiple -grep:regexpr can be provided and the page will
@@ -323,11 +288,32 @@
                   Case insensitive regular expressions will be used and
                   dot matches any character, including a newline.
 
--ql               Filter pages based on page quality.
-                  This is only applicable if contentmodel equals
-                  'proofread-page', otherwise has no effects.
-                  Valid values are in range 0-4.
-                  Multiple values can be comma-separated.
+-intersect        Work on the intersection of all the provided generators.
+
+-limit:n          When used with any other argument that specifies a set
+                  of pages, work on no more than n pages in total.
+
+-namespaces       Filter the page generator to only yield pages in the
+-namespace        specified namespaces. Separate multiple namespace
+-ns               numbers or names with commas.
+                  Examples:
+
+                  -ns:0,2,4
+                  -ns:Help,MediaWiki
+
+                  You may use a preleading "not" to exclude the namespace.
+                  Examples:
+                  -ns:not:2,3
+                  -ns:not:Help,File
+
+                  If used with -newpages/-random/-randomredirect generators,
+                  -namespace/ns must be provided before
+                  -newpages/-random/-randomredirect.
+                  If used with -recentchanges generator, efficiency is
+                  improved if -namespace/ns is provided before -recentchanges.
+
+                  If used with -start generator, -namespace/ns shall contain
+                  only one value.
 
 -onlyif           A claim the page needs to contain, otherwise the item won't
                   be returned.
@@ -347,7 +333,27 @@
                   be returned.
                   For usage and examples, see -onlyif above.
 
--intersect        Work on the intersection of all the provided generators.
+-ql               Filter pages based on page quality.
+                  This is only applicable if contentmodel equals
+                  'proofread-page', otherwise has no effects.
+                  Valid values are in range 0-4.
+                  Multiple values can be comma-separated.
+
+-subpage:n        Filters pages to only those that have depth n
+                  i.e. a depth of 0 filters out all pages that are subpages,
+                  and a depth of 1 filters out all pages that are subpages of
+                  subpages.
+
+-titleregex       A regular expression that needs to match the article title
+                  otherwise the page won't be returned.
+                  Multiple -titleregex:regexpr can be provided and the page
+                  will be returned if title is matched by any of the regexpr
+                  provided.
+                  Case insensitive regular expressions will be used and
+                  dot matches any character.
+
+-titleregexnot    Like -titleregex, but return the page only if the regular
+                  expression does not match.
 """
 
 docuReplacements = {'&params;': parameterHelp}

-- 
To view, visit https://gerrit.wikimedia.org/r/362410
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7054328600292f3306b000d61151d32fa7293f08
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: Dalba <dalba.w...@gmail.com>
Gerrit-Reviewer: Dvorapa <dvor...@seznam.cz>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Magul <tomasz.magul...@gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.w...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to