aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-27 14:39:21 -0400
committerDavid Robillard <d@drobilla.net>2022-05-27 14:39:21 -0400
commit98c4699afb169b2a7744dd86ea0ed04595ea1fc7 (patch)
tree3a90f037d9bfe155552c7cb12b56c104323f4934
parent0592b89e7e707e2363aa6b4332de5b85dd557a75 (diff)
downloadjalv-98c4699afb169b2a7744dd86ea0ed04595ea1fc7.tar.gz
jalv-98c4699afb169b2a7744dd86ea0ed04595ea1fc7.tar.bz2
jalv-98c4699afb169b2a7744dd86ea0ed04595ea1fc7.zip
Add version option to console executable
-rw-r--r--NEWS3
-rw-r--r--src/jalv.c5
-rw-r--r--src/jalv_console.c16
3 files changed, 21 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index aa61dbd..cb5f144 100644
--- a/NEWS
+++ b/NEWS
@@ -1,13 +1,14 @@
jalv (1.6.7) unstable;
* Add missing option in console help output
+ * Add version option to console executable
* Build Qt and Gtkmm versions as C++14
* Clean up and modernize code
* Fix crash when running jalv without arguments
* Flush stdout after printing control values in console interface
* Remove Qt4 support
- -- David Robillard <d@drobilla.net> Fri, 27 May 2022 18:15:03 +0000
+ -- David Robillard <d@drobilla.net> Fri, 27 May 2022 18:38:29 +0000
jalv (1.6.6) stable;
diff --git a/src/jalv.c b/src/jalv.c
index 3c5c004..e474433 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -824,9 +824,10 @@ jalv_open(Jalv* const jalv, int* argc, char*** argv)
suil_init(argc, argv, SUIL_ARG_NONE);
#endif
- if (jalv_init(argc, argv, &jalv->opts)) {
+ int ret = 0;
+ if ((ret = jalv_init(argc, argv, &jalv->opts))) {
jalv_close(jalv);
- return -1;
+ return ret;
}
jalv->symap = symap_new();
diff --git a/src/jalv_console.c b/src/jalv_console.c
index 6b54b28..8c3eaf7 100644
--- a/src/jalv_console.c
+++ b/src/jalv_console.c
@@ -52,10 +52,22 @@ print_usage(const char* name, bool error)
fprintf(os, " -s Show plugin UI if possible\n");
fprintf(os, " -t Print trace messages from plugin\n");
fprintf(os, " -U URI Load the UI with the given URI\n");
+ fprintf(os, " -V Display version information and exit\n");
fprintf(os, " -x Exact JACK client name (exit if taken)\n");
return error ? 1 : 0;
}
+static int
+print_version(void)
+{
+ printf("jalv " JALV_VERSION " <http://drobilla.net/software/jalv>\n");
+ printf("Copyright 2011-2022 David Robillard <d@drobilla.net>.\n"
+ "License ISC: <https://spdx.org/licenses/ISC>.\n"
+ "This is free software; you are free to change and redistribute it."
+ "\nThere is NO WARRANTY, to the extent permitted by law.\n");
+ return 1;
+}
+
void
jalv_ui_port_event(Jalv* jalv,
uint32_t port_index,
@@ -79,6 +91,10 @@ jalv_init(int* argc, char*** argv, JalvOptions* opts)
return print_usage((*argv)[0], true);
}
+ if ((*argv)[a][1] == 'V') {
+ return print_version();
+ }
+
if ((*argv)[a][1] == 's') {
opts->show_ui = true;
} else if ((*argv)[a][1] == 'p') {