From 98c4699afb169b2a7744dd86ea0ed04595ea1fc7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 27 May 2022 14:39:21 -0400 Subject: Add version option to console executable --- src/jalv_console.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/jalv_console.c') 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 " \n"); + printf("Copyright 2011-2022 David Robillard .\n" + "License 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') { -- cgit v1.2.1