summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app.c8
-rw-r--r--src/app.h3
2 files changed, 9 insertions, 2 deletions
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,
449 else if (equal_CommandLineConstIterator(&i, "close-tab")) { 449 else if (equal_CommandLineConstIterator(&i, "close-tab")) {
450 appendCStr_String(cmds, "tabs.close\n"); 450 appendCStr_String(cmds, "tabs.close\n");
451 } 451 }
452 else if (equal_CommandLineConstIterator(&i, "list-tab-urls;L")) { 452 else if (equal_CommandLineConstIterator(&i, listTabUrls_CommandLineOption)) {
453 appendFormat_String(cmds, "ipc.list.urls pid:%d\n", pid); 453 appendFormat_String(cmds, "ipc.list.urls pid:%d\n", pid);
454 } 454 }
455 } 455 }
@@ -481,7 +481,7 @@ static void init_App_(iApp *d, int argc, char **argv) {
481 defineValues_CommandLine(&d->args, "echo;E", 0); 481 defineValues_CommandLine(&d->args, "echo;E", 0);
482 defineValues_CommandLine(&d->args, "go-home", 0); 482 defineValues_CommandLine(&d->args, "go-home", 0);
483 defineValues_CommandLine(&d->args, "help", 0); 483 defineValues_CommandLine(&d->args, "help", 0);
484 defineValues_CommandLine(&d->args, "list-tab-urls;L", 0); 484 defineValues_CommandLine(&d->args, listTabUrls_CommandLineOption, 0);
485 defineValuesN_CommandLine(&d->args, "new-tab", 0, 1); 485 defineValuesN_CommandLine(&d->args, "new-tab", 0, 1);
486 defineValues_CommandLine(&d->args, "sw", 0); 486 defineValues_CommandLine(&d->args, "sw", 0);
487 defineValues_CommandLine(&d->args, "version;V", 0); 487 defineValues_CommandLine(&d->args, "version;V", 0);
@@ -549,6 +549,10 @@ static void init_App_(iApp *d, int argc, char **argv) {
549 communicateWithRunningInstance_App_(d, instance, openCmds); 549 communicateWithRunningInstance_App_(d, instance, openCmds);
550 terminate_App_(0); 550 terminate_App_(0);
551 } 551 }
552 /* Some options are intended only for controlling other instances. */
553 if (contains_CommandLine(&d->args, listTabUrls_CommandLineOption)) {
554 terminate_App_(0);
555 }
552 listen_Ipc(); /* We'll respond to commands from other instances. */ 556 listen_Ipc(); /* We'll respond to commands from other instances. */
553 } 557 }
554 printf("Lagrange: A Beautiful Gemini Client\n"); 558 printf("Lagrange: A Beautiful Gemini Client\n");
diff --git a/src/app.h b/src/app.h
index 9a68c362..015f5a3e 100644
--- a/src/app.h
+++ b/src/app.h
@@ -38,6 +38,9 @@ iDeclareType(MimeHooks)
38iDeclareType(Visited) 38iDeclareType(Visited)
39iDeclareType(Window) 39iDeclareType(Window)
40 40
41/* Command line options strings. */
42#define listTabUrls_CommandLineOption "list-tab-urls;L"
43
41enum iAppDeviceType { 44enum iAppDeviceType {
42 desktop_AppDeviceType, 45 desktop_AppDeviceType,
43 tablet_AppDeviceType, 46 tablet_AppDeviceType,