From c060377e8e9fd0a13e159820f9a950597fa51482 Mon Sep 17 00:00:00 2001
From: Phillip Berndt <phillip.berndt@googlemail.com>
Date: Tue, 3 Apr 2018 22:31:26 +0200
Subject: [PATCH] Version bump: autorandr 1.5

---
 README.md    | 3 +++
 autorandr.py | 9 ++++++++-
 setup.py     | 2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index abc182a..999f353 100644
--- a/README.md
+++ b/README.md
@@ -205,6 +205,9 @@ profiles matching multiple (or any) monitors.
 
 ## Changelog
 
+**autorandr 1.5**
+
+* *2018-01-03* Add --version
 * *2018-01-04* Fixed vertical/horizontal/clone-largest virtual profiles
 * *2018-03-07* Output all non-error messages to stdout instead of stderr
 * *2018-03-25* Add --detected and --current to filter the profile list output
diff --git a/autorandr.py b/autorandr.py
index d54ade8..5a0a686 100755
--- a/autorandr.py
+++ b/autorandr.py
@@ -48,6 +48,8 @@ if sys.version_info.major == 2:
 else:
     import configparser
 
+__version__ = "1.5"
+
 try:
     input = raw_input
 except NameError:
@@ -81,6 +83,7 @@ Usage: autorandr [options]
 --force                 force (re)loading of a profile
 --skip-options <option> comma separated list of xrandr arguments (e.g. "gamma")
                         to skip both in detecting changes and applying a profile
+--version               show version information and exit
 
  If no suitable profile can be identified, the current configuration is kept.
  To change this behaviour and switch to a fallback configuration, specify
@@ -1034,7 +1037,7 @@ def main(argv):
         opts, args = getopt.getopt(argv[1:], "s:r:l:d:cfh",
                                    ["batch", "dry-run", "change", "default=", "save=", "remove=", "load=",
                                     "force", "fingerprint", "config", "debug", "skip-options=", "help",
-                                    "current", "detected"])
+                                    "current", "detected", "version"])
     except getopt.GetoptError as e:
         print("Failed to parse options: {0}.\n"
               "Use --help to get usage information.".format(str(e)),
@@ -1046,6 +1049,10 @@ def main(argv):
     if "-h" in options or "--help" in options:
         exit_help()
 
+    if "--version" in options:
+        print("autorandr " + __version__)
+        sys.exit(0)
+
     if "--current" in options and "--detected" in options:
         print("--current and --detected are mutually exclusive.", file=sys.stderr)
         sys.exit(posix.EX_USAGE)
diff --git a/setup.py b/setup.py
index efe9523..28562ec 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ except:
 setup(
     name='autorandr',
 
-    version='1.4-2',
+    version='1.5-1',
 
     description='Automatically select a display configuration based on connected devices',
     long_description=long_description,
-- 
2.39.5