Add version info. Closes #1.

This commit is contained in:
Solderpunk 2020-05-10 14:34:48 +02:00
parent d8ef677ab1
commit 28cf34e585
1 changed files with 13 additions and 0 deletions

13
av98.py
View File

@ -31,6 +31,8 @@ import sys
import time import time
import webbrowser import webbrowser
_VERSION = "0.0.1"
_MAX_REDIRECTS = 5 _MAX_REDIRECTS = 5
# Command abbreviations # Command abbreviations
@ -872,6 +874,10 @@ Think of it like marks in vi: 'mark a'='ma' and 'go a'=''a'."""
else: else:
print("Invalid mark, must be one letter") 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 ### Stuff that modifies the lookup table
def do_ls(self, line): def do_ls(self, line):
"""List contents of current index. """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-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('--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('--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='*', parser.add_argument('url', metavar='URL', nargs='*',
help='start with this URL') help='start with this URL')
args = parser.parse_args() args = parser.parse_args()
# Handle --version
if args.version:
print("AV-98 " + _VERSION)
sys.exit()
# Instantiate client # Instantiate client
gc = GeminiClient(args.restricted) gc = GeminiClient(args.restricted)