X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aft.c;h=cfb1f69773a73a2f6401bf2b93bfc1be21217412;hp=c4558f2040ac67e0a613177b786438a038f5bcc5;hb=fdb03951ee708a42795d4abb36d3a8637c478975;hpb=8652682aa38c95972e317f84a520d5e2fcabf0c8 diff --git a/aft.c b/aft.c index c4558f20..cfb1f697 100644 --- a/aft.c +++ b/aft.c @@ -1439,18 +1439,26 @@ int com_ls(struct command_context *cc) i++; break; } + /* + * Compatibility: Prior to 0.5.5 it was necessary to specify + * the listing mode without the '=' character as in -lv, for + * example. Now the variant with '=' is preferred and + * documented but we still accept the old way to specify the + * listing mode. + * + * Support for the legacy syntax can be dropped at 0.6.0 + * or later. + */ if (!strncmp(arg, "-l", 2)) { - if (!*(arg + 2)) { - mode = LS_MODE_LONG; - continue; - } - if (*(arg + 3)) - return -E_AFT_SYNTAX; - switch(*(arg + 2)) { + arg += 2; + if (*arg == '=') + arg++; + switch (*arg) { case 's': mode = LS_MODE_SHORT; continue; case 'l': + case '\0': mode = LS_MODE_LONG; continue; case 'v': @@ -1485,10 +1493,12 @@ int com_ls(struct command_context *cc) flags |= LS_FLAG_UNIXDATE; continue; } + /* The compatibility remark above applies also to -s. */ if (!strncmp(arg, "-s", 2)) { - if (!*(arg + 2) || *(arg + 3)) - return -E_AFT_SYNTAX; - switch(*(arg + 2)) { + arg += 2; + if (*arg == '=') + arg++; + switch (*arg) { case 'p': sort = LS_SORT_BY_PATH; continue;