Patchwork [2,of,2] byteify-strings: add --version argument

login
register
mail settings
Submitter Raphaël Gomès
Date Aug. 6, 2019, 12:56 p.m.
Message ID <fcfc777aef1bf534878f.1565096174@alphare-carbon.lan>
Download mbox | patch
Permalink /patch/41169/
State Accepted
Headers show

Comments

Raphaël Gomès - Aug. 6, 2019, 12:56 p.m.
# HG changeset patch
# User Raphaël Gomès <rgomes@octobus.net>
# Date 1565096065 -7200
#      Tue Aug 06 14:54:25 2019 +0200
# Node ID fcfc777aef1bf534878f3318cb826f5d6ef7ed33
# Parent  a6acc71d557b3606a048dd95f26e0b6988682a9c
# EXP-Topic byteify-strings
byteify-strings: add --version argument

This is indispensable for automated tools to detect changes in behavior.

Patch

diff -r a6acc71d557b -r fcfc777aef1b contrib/byteify-strings.py
--- a/contrib/byteify-strings.py	Tue Aug 06 14:49:30 2019 +0200
+++ b/contrib/byteify-strings.py	Tue Aug 06 14:54:25 2019 +0200
@@ -278,6 +278,8 @@ 
 
 def main():
     ap = argparse.ArgumentParser()
+    ap.add_argument('--version', action='version',
+                    version='Byteify strings 1.0')
     ap.add_argument('-i', '--inplace', action='store_true', default=False,
                     help='edit files in place')
     ap.add_argument('--dictiter', action='store_true', default=False,
diff -r a6acc71d557b -r fcfc777aef1b tests/test-byteify-strings.t
--- a/tests/test-byteify-strings.t	Tue Aug 06 14:49:30 2019 +0200
+++ b/tests/test-byteify-strings.t	Tue Aug 06 14:54:25 2019 +0200
@@ -4,6 +4,11 @@ 
   >   $PYTHON "$TESTDIR/../contrib/byteify-strings.py" "$@"
   > }
 
+Test version
+
+  $ byteify_strings --version
+  Byteify strings * (glob)
+
 Test in-place
 
   $ cat > testfile.py <<EOF