jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/738577 )
Change subject: [IMPR] Enable -version and --version with pwb wrapper or code entry point ......................................................................
[IMPR] Enable -version and --version with pwb wrapper or code entry point
Bug: T101828 Change-Id: Iedaa31b2e94f4d9f833066baa729673f7148f065 --- M pwb.py 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pwb.py b/pwb.py index b8ddd82..e5414b8 100755 --- a/pwb.py +++ b/pwb.py @@ -141,13 +141,16 @@ fname = None index = 0 for arg in args: - if arg.startswith('-'): + if arg in ('-version', '--version'): + fname = 'version.py' + elif arg.startswith('-'): index += 1 + continue else: fname = arg if not fname.endswith('.py'): fname += '.py' - break + break return fname, list(args[index + int(bool(fname)):]), args[:index]
pywikibot-commits@lists.wikimedia.org