From 598fdc396f5b77a3b929493c098d9a896750d2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 7 Jan 2016 23:42:41 +0100 Subject: [PATCH] Print session list if neither action nor session name was given In particular $ abduco -e ^q will now also print the session list which is useful if the default detach key is changed by means of a shell alias. Closes #10 --- abduco.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abduco.c b/abduco.c index 8c08667..4da3f97 100644 --- a/abduco.c +++ b/abduco.c @@ -575,8 +575,6 @@ int main(int argc, char *argv[]) { char **cmd = NULL, action = '\0'; server.name = basename(argv[0]); gethostname(server.host+1, sizeof(server.host) - 1); - if (argc == 1) - exit(list_session()); while ((opt = getopt(argc, argv, "aAclne:frv")) != -1) { switch (opt) { @@ -624,6 +622,8 @@ int main(int argc, char *argv[]) { cmd[0] = "dvtm"; } + if (!action && !server.session_name) + exit(list_session()); if (!action || !server.session_name) usage();