From 4b4884dd7cdbce7194fec24e782dd09d3c430a8f Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 1 Mar 2021 09:11:20 +0200 Subject: Listing open tabs via command line IssueID #178 --- src/app.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/app.c') diff --git a/src/app.c b/src/app.c index 8a02ec3f..2614c454 100644 --- a/src/app.c +++ b/src/app.c @@ -449,7 +449,7 @@ static void communicateWithRunningInstance_App_(iApp *d, iProcessId instance, else if (equal_CommandLineConstIterator(&i, "close-tab")) { appendCStr_String(cmds, "tabs.close\n"); } - else if (equal_CommandLineConstIterator(&i, "list-tab-urls;L")) { + else if (equal_CommandLineConstIterator(&i, listTabUrls_CommandLineOption)) { appendFormat_String(cmds, "ipc.list.urls pid:%d\n", pid); } } @@ -481,7 +481,7 @@ static void init_App_(iApp *d, int argc, char **argv) { defineValues_CommandLine(&d->args, "echo;E", 0); defineValues_CommandLine(&d->args, "go-home", 0); defineValues_CommandLine(&d->args, "help", 0); - defineValues_CommandLine(&d->args, "list-tab-urls;L", 0); + defineValues_CommandLine(&d->args, listTabUrls_CommandLineOption, 0); defineValuesN_CommandLine(&d->args, "new-tab", 0, 1); defineValues_CommandLine(&d->args, "sw", 0); defineValues_CommandLine(&d->args, "version;V", 0); @@ -549,6 +549,10 @@ static void init_App_(iApp *d, int argc, char **argv) { communicateWithRunningInstance_App_(d, instance, openCmds); terminate_App_(0); } + /* Some options are intended only for controlling other instances. */ + if (contains_CommandLine(&d->args, listTabUrls_CommandLineOption)) { + terminate_App_(0); + } listen_Ipc(); /* We'll respond to commands from other instances. */ } printf("Lagrange: A Beautiful Gemini Client\n"); -- cgit v1.2.3