summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Henrik Brautaset Aronsen <subsurface@henrik.synth.no>2013-05-27 12:15:34 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-29 19:22:02 +0900
commit9e130c902c6f349aab7954f954556d56557cc4fd (patch)
tree73a502a3d8c143fcf16c2cabac601f829ce13484 /main.c
parentda52ff56b2cc2b4aecda03b4f21f94ce3ff0ce22 (diff)
downloadsubsurface-9e130c902c6f349aab7954f954556d56557cc4fd.tar.gz
Add --version to command line options
Displays Subsurface and libdivecomputer versions. Suggested-by: Jef Driesen <jefdriesen@telenet.be> Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.c b/main.c
index 383a80328..9afaa3d03 100644
--- a/main.c
+++ b/main.c
@@ -9,6 +9,8 @@
#include "dive.h"
#include "divelist.h"
+#include "libdivecomputer.h"
+#include "version.h"
struct preferences prefs;
struct preferences default_prefs = {
@@ -98,6 +100,11 @@ static void parse_argument(const char *arg)
imported = TRUE;
return;
}
+ if (strcmp(arg, "--version") == 0) {
+ printf("Subsurface v%s, ", VERSION_STRING);
+ printf("built with libdivecomputer v%s\n", dc_version(NULL));
+ exit(0);
+ }
/* fallthrough */
case 'p':
/* ignore process serial number argument when run as native macosx app */