aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Schlömer <nico.schloemer@gmail.com>2020-07-23 14:19:42 +0200
committerNico Schlömer <nico.schloemer@gmail.com>2020-07-23 14:19:42 +0200
commitdc7b9ef6cfb1cdeb067188deb2bcdcf6808afe06 (patch)
tree98de6bff6fa615d3488e36392432fbfa4dd7a230
parent3e59a58522d3f9c4a359ba33cbe9d1609ce067b4 (diff)
downloadautotiling-dc7b9ef6cfb1cdeb067188deb2bcdcf6808afe06.tar.gz
add --version
-rw-r--r--autotiling/main.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/autotiling/main.py b/autotiling/main.py
index d253999..f3644a7 100644
--- a/autotiling/main.py
+++ b/autotiling/main.py
@@ -18,6 +18,8 @@ from functools import partial
from i3ipc import Connection, Event
+from .__about__ import __version__
+
def switch_splitting(i3, e, debug):
try:
@@ -69,6 +71,14 @@ def main():
parser.add_argument(
"--debug", action="store_true", help="Print debug messages to stderr"
)
+ parser.add_argument(
+ "--version",
+ "-v",
+ action="version",
+ version="%(prog)s {}, Python {}".format(__version__, sys.version),
+ help="display version information",
+ )
+
args = parser.parse_args()
handler = partial(switch_splitting, debug=args.debug)
i3 = Connection()