Xqt created this task.
Xqt added projects: Pywikibot, Pywikibot-Documentation.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION
pywikibot.handle_args() can be used to handle global options within scripts
like
options = {}
local_args = pywikibot.handle_args()
for arg in local_args;
arg, _, value = arg.partition(':')
if not arg.startswith('-'):
continue
option[arg] = value
but global options can changes and private options can be hidden by such
implementation. Vice versa if the local optionas are handled first, the global
options could be discarded.
**Problen:**
The problem is that global options can be changed or expanded at any time.
There is no way to deprecate renamed options or warn for new ones.
**Solution**
The prefered way is to use global options throught the pwb wrapper script as
descibed
there:https://doc.wikimedia.org/pywikibot/master/utilities/scripts_ref.html#module-pywikibot.scripts.wrapper
`python pwb.py <global pwb options> <name_of_script> <local script options>`
Using this proposal the pywikibot.handle_args is no longer necessary to be
used within the script.
This mehtod should be more documented.
TASK DETAIL
https://phabricator.wikimedia.org/T359766
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Xqt
Cc: Aklapper, pywikibot-bugs-list, Xqt, mevo, PotsdamLamb, Jyoo1011,
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Urstrulykkr, Viztor, Wenyi,
Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx,
jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]