changeset 42701:11498aa91c03

byteify-strings: add --version argument This is indispensable for automated tools to detect changes in behavior.
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 06 Aug 2019 14:54:25 +0200
parents f9b64ff9d26b
children 4814d993fe21
files contrib/byteify-strings.py tests/test-byteify-strings.t
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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,
--- 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