aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2018-06-06 12:29:52 -0400
committerGitHub <noreply@github.com>2018-06-06 12:29:52 -0400
commit6e0991598728a2ffb20491e440a1f495c5899874 (patch)
tree66bf71dd217a1ffe680e5ca02e902cecb20109d4
parent9ec5a7160f9b38fa9042b57988349defac6971c4 (diff)
parenta25af465719d66b46b35c4d3327ff4733c54a35a (diff)
downloadfirewatch-0.0.2.tar.gz
Merge pull request #2 from jhunkeler/add-version0.0.2
Add --version argument
-rw-r--r--firewatch/__init__.py1
-rw-r--r--firewatch/firewatch.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/firewatch/__init__.py b/firewatch/__init__.py
index e69de29..0eea61c 100644
--- a/firewatch/__init__.py
+++ b/firewatch/__init__.py
@@ -0,0 +1 @@
+from .version import *
diff --git a/firewatch/firewatch.py b/firewatch/firewatch.py
index df17e8a..5360ad2 100644
--- a/firewatch/firewatch.py
+++ b/firewatch/firewatch.py
@@ -189,8 +189,15 @@ def main():
help=f'i[{"|".join([x for x in time_units.keys()])}]'
' (120s, 12h, 1d, 2w, 3m, 4y)')
+ parser.add_argument('--version', '-V', action='store_true',
+ help='Display software version')
args = parser.parse_args()
+ if args.version:
+ from . import __version__
+ print(__version__)
+ exit(0)
+
order = False # Ascending
if args.order != 'asc':
order = True # Descending