summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-05-12 17:49:12 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-05-12 18:03:23 +0200
commitaf678af0d5c9ef3d8afdc0789b33dd0c40b6d6e5 (patch)
tree4d786cd3fecdbb370f1ceee5daecd3aa62fc205b /client
parent286e2011d22ea6914d5f2db5de3f11911a1fb663 (diff)
parent8e433d6a529a883d566dc1d5a4afe0f1e2750baf (diff)
Merge remote-tracking branch 'origin/master' into int-new
Diffstat (limited to 'client')
-rw-r--r--client/client.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/client/client.c b/client/client.c
index b938f344..4075b9e6 100644
--- a/client/client.c
+++ b/client/client.c
@@ -37,7 +37,7 @@
#define SERVER_READ_BUF_LEN 4096
-static char *opt_list = "s:vr";
+static char *opt_list = "s:vrl";
static int verbose, restricted, once;
static char *init_cmd;
@@ -59,13 +59,14 @@ int term_lns, term_cls;
static void
usage(char *name)
{
- fprintf(stderr, "Usage: %s [-s <control-socket>] [-v] [-r]\n", name);
+ fprintf(stderr, "Usage: %s [-s <control-socket>] [-v] [-r] [-l]\n", name);
exit(1);
}
static void
parse_args(int argc, char **argv)
{
+ int server_changed = 0;
int c;
while ((c = getopt(argc, argv, opt_list)) >= 0)
@@ -73,6 +74,7 @@ parse_args(int argc, char **argv)
{
case 's':
server_path = optarg;
+ server_changed = 1;
break;
case 'v':
verbose++;
@@ -80,6 +82,10 @@ parse_args(int argc, char **argv)
case 'r':
restricted = 1;
break;
+ case 'l':
+ if (!server_changed)
+ server_path = xbasename(server_path);
+ break;
default:
usage(argv[0]);
}