AV-98-fork

A fork of https://tildegit.org/solderpunk/AV-98
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 28cf34e585110611ec7bc219523e9948e865f9da
parent d8ef677ab15996e013ec71615c8a184ef558ded9
Author: Solderpunk <solderpunk@sdf.org>
Date:   Sun, 10 May 2020 14:34:48 +0200

Add version info.  Closes #1.

Diffstat:
Mav98.py | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/av98.py b/av98.py @@ -31,6 +31,8 @@ import sys import time import webbrowser +_VERSION = "0.0.1" + _MAX_REDIRECTS = 5 # Command abbreviations @@ -872,6 +874,10 @@ Think of it like marks in vi: 'mark a'='ma' and 'go a'=''a'.""" else: print("Invalid mark, must be one letter") + def do_version(self, line): + """Display version information.""" + print("AV-98 " + _VERSION) + ### Stuff that modifies the lookup table def do_ls(self, line): """List contents of current index. @@ -1118,10 +1124,17 @@ def main(): parser.add_argument('--tls-cert', metavar='FILE', help='TLS client certificate file') parser.add_argument('--tls-key', metavar='FILE', help='TLS client certificate private key file') parser.add_argument('--restricted', action="store_true", help='Disallow shell, add, and save commands') + parser.add_argument('--version', action='store_true', + help='display version information and quit') parser.add_argument('url', metavar='URL', nargs='*', help='start with this URL') args = parser.parse_args() + # Handle --version + if args.version: + print("AV-98 " + _VERSION) + sys.exit() + # Instantiate client gc = GeminiClient(args.restricted)