Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1177944?usp=email )
Change subject: IMPR: Add help options for addwikis script
......................................................................
IMPR: Add help options for addwikis script
The old 'help' is missleading; show a deprecation warning for it.
Change-Id: I3d8d1b32b6ba9b5dfda36d3595addcf4ab2501a0
---
M scripts/maintenance/addwikis.py
1 file changed, 15 insertions(+), 2 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/maintenance/addwikis.py b/scripts/maintenance/addwikis.py
index b7cfaf3..11784f4 100755
--- a/scripts/maintenance/addwikis.py
+++ b/scripts/maintenance/addwikis.py
@@ -7,9 +7,13 @@
.. versionadded:: 9.2
+.. versionchanged:: 10.4
+ The options ``-h``, ``-help`` and ``--help`` display the help message.
+.. deprecated:: 10.4
+ The ``help`` option
"""
#
-# (C) Pywikibot team, 2024
+# (C) Pywikibot team, 2024-2025
#
# Distributed under the terms of the MIT license.
#
@@ -20,7 +24,9 @@
from pathlib import Path
import pywikibot
+from pywikibot.exceptions import ArgumentDeprecationWarning
from pywikibot.family import Family
+from pywikibot.tools import issue_deprecation_warning
# supported families by this script
@@ -87,7 +93,14 @@
for arg in args:
if arg.startswith('-family'):
family = arg.split(':')[1]
- elif arg == 'help':
+ elif arg in ('help', '-h', '-help', '--help'):
+ if arg == 'help':
+ issue_deprecation_warning(
+ "'help' option",
+ "'-h', '-help' or '--help'",
+ since='10.4.0',
+ warning_class=ArgumentDeprecationWarning
+ )
pywikibot.show_help()
return
else:
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1177944?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I3d8d1b32b6ba9b5dfda36d3595addcf4ab2501a0
Gerrit-Change-Number: 1177944
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]