To my understanding the parameter -pairs in movepages.py is equal to -replacementfile in replace.py. It would be better to change -replacementfile to -pairs to prevent confusion and to shorten it.
Description
Details
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| Change: Unify name of parameters -pairs and -replacementfile in scripts | pywikibot/core | master | +24 -10 |
Related Objects
Event Timeline
A "pair" in replace.py is usually a replacement pair (see e.g. ERROR: Incomplete command line pattern replacement pair.)
So -pairs might not be the best name.
-pagepairs for both of them maybe?
replace's -replacementfile has a bit different file format, but there are enough similarities to justify using the same option name. -pairsfile ?
Just an idea: movepages -pairs could use -file , as its file has the same file format as the pagegenerators -file, and it even uses the same pagegenerators.TextfilePageGenerator. It uses the content of the file slightly differently, so it can't re-use the pagegenerator documentation (unless it was rewritten to be more generic, but that may mean it isnt helpful).
IMO the -replacementfile format is a poor substitute for user-fixes.py, as the -replacementfile file contents is interpreted differently depending on -regex and other command line options, and should probably be deprecated.
I'm going with -pairsfile, as suggested above.
Apart from the respective files in core, what else should I update to reflect this change?
Change 275025 had a related patch set uploaded (by Darthbhyrava):
Change: Unify name of parameters -pairs and -replacementfile in scripts
I've added a patch, and would be much obliged if someone could give me some feedback.
Thanks. :)
Change 275025 merged by jenkins-bot:
Change: Unify name of parameters -pairs and -replacementfile in scripts