# HG changeset patch # User Raphaël Gomès # Date 2019-08-06 12:54:25 # Node ID 11498aa91c036c6d70f7ac5ee5af2664a84a1130 # Parent f9b64ff9d26ba64c9c3b1980f3fcef581a5802ab byteify-strings: add --version argument This is indispensable for automated tools to detect changes in behavior. diff --git a/contrib/byteify-strings.py b/contrib/byteify-strings.py --- a/contrib/byteify-strings.py +++ b/contrib/byteify-strings.py @@ -278,6 +278,8 @@ def editinplace(fname): 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 --git a/tests/test-byteify-strings.t b/tests/test-byteify-strings.t --- a/tests/test-byteify-strings.t +++ b/tests/test-byteify-strings.t @@ -4,6 +4,11 @@ > $PYTHON "$TESTDIR/../contrib/byteify-strings.py" "$@" > } +Test version + + $ byteify_strings --version + Byteify strings * (glob) + Test in-place $ cat > testfile.py <