diff --git a/mailfmt.py b/mailfmt.py index 1af4272..995e9aa 100755 --- a/mailfmt.py +++ b/mailfmt.py @@ -15,6 +15,7 @@ import argparse import re import sys import textwrap +from importlib.metadata import version def main() -> None: @@ -93,6 +94,13 @@ Contact : daniel@ficd.sh """, formatter_class=argparse.RawDescriptionHelpFormatter, ) + parser.add_argument( + "-v", + "--version", + required=False, + help="Print version info and exit.", + action="store_true", + ) parser.add_argument( "-w", "--width", @@ -162,6 +170,9 @@ Contact : daniel@ficd.sh help="Output file. (default: %(default)s)", ) args = parser.parse_args() + if args.version: + print(version("mailfmt")) + exit(0) width = args.width should_check_signoff = args.no_signoff should_check_signature = args.no_signature diff --git a/pyproject.toml b/pyproject.toml index 583a3bc..5694f65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [project] name = "mailfmt" -version = "1.0.3" +version = "1.0.4" description = "Heuristic plain text email formatter." readme = "README.md" authors = [ - { name = "Daniel Fichtinger", email = "daniel@ficd.ca" } + { name = "Daniel Fichtinger", email = "daniel@ficd.sh" } ] requires-python = ">=3.11" dependencies = [] diff --git a/uv.lock b/uv.lock index 927ca8f..029043b 100644 --- a/uv.lock +++ b/uv.lock @@ -4,5 +4,5 @@ requires-python = ">=3.11" [[package]] name = "mailfmt" -version = "1.0.1" +version = "1.0.3" source = { editable = "." }