From 8c9bc15677a720b542432cac6bb09aa1738736fd Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 18 Mar 2012 04:53:28 +0100 Subject: [PATCH] Add --version --- servefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servefile b/servefile index b717ffc..79a9ed2 100755 --- a/servefile +++ b/servefile @@ -4,7 +4,8 @@ # Licensed under GNU General Public License v3 or later # Written by Sebastian Lohff (seba@seba-geek.de) # http://seba-geek.de/stuff/servefile/ -# v0.3.1 + +__version__ = '0.3.1' import argparse import BaseHTTPServer @@ -87,6 +88,7 @@ class ThreadedHTTPServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer) def main(): parser = argparse.ArgumentParser() + parser.add_argument('--version', action='version', version='%(prog)s ' + __version__) parser.add_argument('filename', metavar='file/directory', type=str) parser.add_argument('-p', '--port', type=int, default=8080, \ help='port to listen on')