abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 598fdc396f5b77a3b929493c098d9a896750d2bd
parent f7b65db3caa3c668d03fc6a970d4f5b24ce372d8
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu,  7 Jan 2016 23:42:41 +0100

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

Diffstat:
abduco.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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();