From 179200bf87a153e1103a3bbe6133c9f5339d62d2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 9 Oct 2015 22:00:54 +0000 Subject: Allow Jack client name to be set from command line git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@5760 a436a847-0d15-0410-975c-d299462d15a1 --- src/jalv_console.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/jalv_console.c') diff --git a/src/jalv_console.c b/src/jalv_console.c index 79cde0f..b17779b 100644 --- a/src/jalv_console.c +++ b/src/jalv_console.c @@ -39,6 +39,8 @@ print_usage(const char* name, bool error) fprintf(os, " -l DIR Load state from save directory\n"); fprintf(os, " -d DIR Dump plugin <=> UI communication\n"); fprintf(os, " -b SIZE Buffer size for plugin <=> UI communication\n"); + fprintf(os, " -n NAME JACK client name\n"); + fprintf(os, " -x Exact JACK client name (exit if taken)\n"); return error ? 1 : 0; } @@ -101,6 +103,15 @@ jalv_init(int* argc, char*** argv, JalvOptions* opts) opts->controls[n_controls] = NULL; } else if ((*argv)[a][1] == 'd') { opts->dump = true; + } else if ((*argv)[a][1] == 'n') { + if (++a == *argc) { + fprintf(stderr, "Missing argument for -n\n"); + return 1; + } + free(opts->name); + opts->name = jalv_strdup((*argv)[a]); + } else if ((*argv)[a][1] == 'x') { + opts->name_exact = 1; } else { fprintf(stderr, "Unknown option %s\n", (*argv)[a]); return print_usage((*argv)[0], true); -- cgit v1.2.1