summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-01-16 18:03:54 +0000
committerDavid Robillard <d@drobilla.net>2015-01-16 18:03:54 +0000
commit80b04e80100eadcb20527a4ad9ee54f75a71111a (patch)
tree30a47335016141018622258ff68fa43412a8464a
parent4b5a08b27a051a6313f5684fe26d54ac450ca740 (diff)
downloadingen-80b04e80100eadcb20527a4ad9ee54f75a71111a.tar.gz
ingen-80b04e80100eadcb20527a4ad9ee54f75a71111a.tar.bz2
ingen-80b04e80100eadcb20527a4ad9ee54f75a71111a.zip
Add standard version flag.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5519 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/Configuration.cpp1
-rw-r--r--src/ingen/ingen.cpp14
2 files changed, 15 insertions, 0 deletions
diff --git a/src/Configuration.cpp b/src/Configuration.cpp
index 51aff65f..6fea2862 100644
--- a/src/Configuration.cpp
+++ b/src/Configuration.cpp
@@ -55,6 +55,7 @@ Configuration::Configuration(Forge& forge)
add("socket", "socket", 'S', "Engine socket path", SESSION, forge.String, forge.alloc("/tmp/ingen.sock"));
add("gui", "gui", 'g', "Launch the GTK graphical interface", SESSION, forge.Bool, forge.make(false));
add("", "help", 'h', "Print this help message", SESSION, forge.Bool, forge.make(false));
+ add("", "version", 'V', "Print version information", SESSION, forge.Bool, forge.make(false));
add("jackName", "jack-name", 'n', "JACK name", SESSION, forge.String, forge.alloc("ingen"));
add("jackServer", "jack-server", 's', "JACK server name", GLOBAL, forge.String, forge.alloc(""));
add("uuid", "uuid", 'u', "JACK session UUID", SESSION, forge.String, Atom());
diff --git a/src/ingen/ingen.cpp b/src/ingen/ingen.cpp
index 6e058414..f37608b9 100644
--- a/src/ingen/ingen.cpp
+++ b/src/ingen/ingen.cpp
@@ -70,6 +70,18 @@ ingen_try(bool cond, const char* msg)
}
}
+static int
+print_version()
+{
+ cout << "ingen " << INGEN_VERSION
+ << " <http://drobilla.net/software/ingen>\n"
+ << "Copyright 2007-2015 David Robillard <http://drobilla.net>.\n"
+ << "License: <https://www.gnu.org/licenses/agpl-3.0>\n"
+ << "This is free software; you are free to change and redistribute it.\n"
+ << "There is NO WARRANTY, to the extent permitted by law." << endl;
+ return EXIT_SUCCESS;
+}
+
int
main(int argc, char** argv)
{
@@ -85,6 +97,8 @@ main(int argc, char** argv)
} else if (world->conf().option("help").get<int32_t>()) {
world->conf().print_usage("ingen", cout);
return EXIT_SUCCESS;
+ } else if (world->conf().option("version").get<int32_t>()) {
+ return print_version();
}
} catch (std::exception& e) {
cout << "ingen: " << e.what() << endl;