[Pywikipedia-l] [ pywikipediabot-Bugs-1880264 ] Collision of commandline arguments

SourceForge.net noreply at sourceforge.net
Sat Jan 26 22:13:42 UTC 2008


Bugs item #1880264, was opened at 2008-01-26 07:55
Message generated for change (Comment added) made by andreasjs
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1880264&group_id=93107

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bernhard Mayr (falk_steinhauer)
Assigned to: Nobody/Anonymous (nobody)
Summary: Collision of commandline arguments

Initial Comment:
The "-regex" options of pagegenerators.py and replace.py are colliding.

replace.py -regex:.*AnyPostfix "search" "replace"

is a valid command, whereas

replace.py -regex "search" "replace"

isn't, because "-regex" is interpreted as a command for replace.py, but

add_text.py -regex "any text"

is a similar call that works properly and requests the desired regular expression interactively.


I recommend to change the new option of pagegenerators.py to "-regexp".



----------------------------------------------------------------------

>Comment By: AndreasJS (andreasjs)
Date: 2008-01-26 17:13

Message:
Logged In: YES 
user_id=1738850
Originator: NO

-regex is used in many other bots that use the standard pagegenerator.
I would rather change the option for replace.py to -useregex. 
A warning could be issued if the -regex option is used:

        else:
            generator = genFactory.handleArg(arg)
            if arg == '-regex':
                wikipedia.output(u'Warning: changed parameter name. To
make replacements using regular expressions use -useregex



----------------------------------------------------------------------

Comment By: AndreasJS (andreasjs)
Date: 2008-01-26 17:13

Message:
Logged In: YES 
user_id=1738850
Originator: NO

-regex is used in many other bots that use the standard pagegenerator.
I would rather change the option for replace.py to -useregex. 
A warning could be issued if the -regex option is used:

        else:
            generator = genFactory.handleArg(arg)
            if arg == '-regex':
                wikipedia.output(u'Warning: changed parameter name. To
make replacements using regular expressions use -useregex



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1880264&group_id=93107



More information about the Pywikipedia-l mailing list