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
This commit is contained in:
Marc André Tanner 2016-01-07 23:42:41 +01:00
parent f7b65db3ca
commit 598fdc396f
1 changed files with 2 additions and 2 deletions

View File

@ -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();