jenkins-bot has submitted this change and it was merged.

Change subject: [IMPR] Simplify arg parsing
......................................................................


[IMPR] Simplify arg parsing

Change-Id: Ibeffc07397f5f65bd970352f67a8022b2c194e81
---
M scripts/misspelling.py
1 file changed, 7 insertions(+), 9 deletions(-)

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



diff --git a/scripts/misspelling.py b/scripts/misspelling.py
index 3551f2a..fb69c15 100755
--- a/scripts/misspelling.py
+++ b/scripts/misspelling.py
@@ -22,7 +22,7 @@
                wikipedia, user, etc. namespaces.
 """
 # (C) Daniel Herding, 2007
-# (C) Pywikibot team, 2007-2015
+# (C) Pywikibot team, 2007-2016
 #
 # Distributed under the terms of the MIT license.
 #
@@ -173,14 +173,12 @@
     firstPageTitle = None
 
     for arg in pywikibot.handle_args(args):
-        if arg.startswith('-always:'):
-            always = arg[8:]
-        elif arg.startswith('-start'):
-            if len(arg) == 6:
-                firstPageTitle = pywikibot.input(
-                    u'At which page do you want to start?')
-            else:
-                firstPageTitle = arg[7:]
+        arg, sep, value = arg.partition(':')
+        if arg == '-always':
+            always = value
+        elif arg == '-start':
+            firstPageTitle = value or pywikibot.input(
+                'At which page do you want to start?')
         elif arg == '-main':
             main_only = True
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibeffc07397f5f65bd970352f67a8022b2c194e81
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to