summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2014-09-19 17:21:05 +0200
committerFlorian Bruhin <git@the-compiler.org>2014-09-19 17:21:05 +0200
commit749b0c7427c32c4b30613958c2f1e54d182effd2 (patch)
treeb92f401aaf00d46e6400a275c8c1466a0e4ad0b1
parentc0d0d611466cee89751895075f9a5ff52a5799d6 (diff)
downloadjournalwatch-749b0c7427c32c4b30613958c2f1e54d182effd2.tar.gz
journalwatch-749b0c7427c32c4b30613958c2f1e54d182effd2.zip
Add --version
-rwxr-xr-xjournalwatch.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/journalwatch.py b/journalwatch.py
index f2a9c0b..3536c3d 100755
--- a/journalwatch.py
+++ b/journalwatch.py
@@ -49,6 +49,9 @@ from datetime import datetime, timedelta
from email.mime.text import MIMEText
+__version__ = "0.2.1"
+
+
HOME = os.path.expanduser("~")
XDG_DATA_HOME = os.environ.get("XDG_DATA_HOME",
os.path.join(HOME, ".local", "share"))
@@ -163,6 +166,7 @@ def parse_args():
parents=[conf_parser],
description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
+ prog='journalwatch',
)
parser.set_defaults(**defaults)
parser.add_argument('action', nargs='?', choices=['print', 'mail'],
@@ -192,6 +196,8 @@ def parse_args():
"{start}: The timestamp when journalwatch began"
"searching.\n"
"{end}: The current time when sending the message.")
+ parser.add_argument('--version', action='version',
+ version='%(prog)s {}'.format(__version__))
ns = parser.parse_args(remaining_argv)
return ns