summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Gallo <aamsgallo@gmail.com>2017-09-16 01:02:32 +0200
committerAlejandro Gallo <aamsgallo@gmail.com>2017-09-16 01:02:32 +0200
commite43e31b43d2a4844fb396efed96a6efcd8562f1d (patch)
treeeca3503c7b56338274ff7f6a6a97891ee6012497
parent26c1ed4ebb2bc0d8b20d3f44755519f49c3934f7 (diff)
Add --version flagv0.1.4
-rw-r--r--papis/__init__.py2
-rw-r--r--papis/commands/default.py13
2 files changed, 14 insertions, 1 deletions
diff --git a/papis/__init__.py b/papis/__init__.py
index 75fb1032..83f668e7 100644
--- a/papis/__init__.py
+++ b/papis/__init__.py
@@ -1,7 +1,7 @@
# Information
__license__ = 'GPL3'
-__version__ = '0.1.3'
+__version__ = '0.1.4'
__author__ = __maintainer__ = 'Alejandro Gallo'
__email__ = 'aamsgallo@gmail.com'
diff --git a/papis/commands/default.py b/papis/commands/default.py
index e0849efe..920f9580 100644
--- a/papis/commands/default.py
+++ b/papis/commands/default.py
@@ -1,5 +1,6 @@
import os
import sys
+import papis
import papis.api
import papis.config
import papis.commands
@@ -19,6 +20,14 @@ class Command(papis.commands.Command):
)
self.default_parser.add_argument(
+ "-V",
+ "--version",
+ help="Show version number",
+ default=False,
+ action="store_true"
+ )
+
+ self.default_parser.add_argument(
"-l",
"--lib",
help="Choose a library name or library path (unamed library)",
@@ -93,6 +102,10 @@ class Command(papis.commands.Command):
format=log_format
)
+ if self.args.version:
+ print('Papis - %s' % papis.__version__)
+ sys.exit(0)
+
if self.args.set:
key_vals = [d.split("=") for d in self.args.set.split(",")]
for pair in key_vals: