From 378d58a50292e99859194f0bdf69ee8245268976 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Sun, 22 Sep 2019 20:36:57 -0400 Subject: [PATCH] Add command line argument to print version --- CHANGELOG.md | 2 ++ jetforce.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19c6fc3..b1c36df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### Unreleased +- +- Added ``-V`` / ``--version`` argument to display the version and exit. - Force URLs to always end in trailing slashes when serving a directory. This reduces duplicate selectors and makes resolving relative links more reliable. diff --git a/jetforce.py b/jetforce.py index 42fa77c..bdaef13 100755 --- a/jetforce.py +++ b/jetforce.py @@ -616,6 +616,9 @@ def command_line_parser() -> argparse.ArgumentParser: description="An Experimental Gemini Protocol Server", formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) + parser.add_argument( + "-V", "--version", action="version", version="jetforce " + __version__ + ) parser.add_argument("--host", help="Server address to bind to", default="127.0.0.1") parser.add_argument("--port", help="Server port to bind to", type=int, default=1965) parser.add_argument("--hostname", help="Server hostname", default="localhost")