diff --git a/abduco.1 b/abduco.1 index e9a7448..b2d2a59 100644 --- a/abduco.1 +++ b/abduco.1 @@ -6,6 +6,13 @@ abduco - terminal session manager .B abduco .RB [ \-e .IR detachkey ] +.RB name +.RB command +.RI [ args \ ... "" ] +.br +.B abduco +.RB [ \-e +.IR detachkey ] .RB \-c .RB name .RB command @@ -106,6 +113,7 @@ Create a new session but do not attach to it. .TP .BI \-A Try to connect to an existing session, upon failure create said session and attach immediately to it. +This is the default action when no flags are specified. .TP .BI \-a Attach to an existing session. diff --git a/abduco.c b/abduco.c index 84fa382..ed1e139 100644 --- a/abduco.c +++ b/abduco.c @@ -477,7 +477,7 @@ static int list_session(void) { } int main(int argc, char *argv[]) { - char **cmd = NULL, action = '\0'; + char **cmd = NULL, action = ACTION_DEFAULT; server.name = basename(argv[0]); gethostname(server.host+1, sizeof(server.host) - 1); if (argc == 1) @@ -527,7 +527,7 @@ int main(int argc, char *argv[]) { cmd[0] = "dvtm"; } - if (!action || !server.session_name || + if (!server.session_name || ((action == 'c' || action == 'C' || action == 'A') && client.readonly)) usage(); diff --git a/config.def.h b/config.def.h index b52452e..7e67cbe 100644 --- a/config.def.h +++ b/config.def.h @@ -1,2 +1,3 @@ static char KEY_DETACH = CTRL('\\'); static char KEY_REDRAW = 0; +static char ACTION_DEFAULT = 'A';