Mercurial > hgrepos > Python > apps > py-cutils
changeset 13:db64e282b049
Implement a version option
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 04 Dec 2020 17:41:17 +0100 |
| parents | 5e2c9123f93f |
| children | 409dac636805 |
| files | shasum.py |
| diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/shasum.py Fri Dec 04 17:37:56 2020 +0100 +++ b/shasum.py Fri Dec 04 17:41:17 2020 +0100 @@ -12,6 +12,10 @@ from __future__ import print_function + +__version__ = "0.1.b1" + + import argparse import hashlib import io @@ -50,6 +54,8 @@ "--text", "-t", action="store_true", dest="text_mode", default=False, help="read in text mode (not supported)") aparser.add_argument( + "--version", "-v", action="version", version=__version__) + aparser.add_argument( "files", nargs="*", metavar="FILE") opts = aparser.parse_args(args=argv)
