From: Andre Noll Date: Mon, 26 Dec 2016 12:27:01 +0000 (+0100) Subject: Merge branch 'refs/heads/t/ls-p_deprecation' X-Git-Tag: v0.5.7~13 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=a80869e84654120689bd63b4a0f944bd1124332e;hp=0829285d0c0252b2bf3e428760b46c2d0e4dfff2 Merge branch 'refs/heads/t/ls-p_deprecation' Preparation for changing the semantics of the -p option to com_ls() of para_server. Cooking for four months. * refs/heads/t/ls-p_deprecation: server: Deprecate ls -p. --- diff --git a/NEWS.md b/NEWS.md index 38d1d5b0..37d855b9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,8 @@ NEWS The doxygen API reference still contains an HTML version of each source file. - Two race conditions in para_server have been fixed. +- ls -p is now deprecated in favor of -F or -b. See the help text of + the ls command for details. Download: [tarball](./releases/paraslash-git.tar.bz2) diff --git a/afs.cmd b/afs.cmd index 584ba809..76b5f4dc 100644 --- a/afs.cmd +++ b/afs.cmd @@ -51,8 +51,13 @@ H: p: parser-friendly mode H: m: mbox listing mode H: c: chunk-table listing mode H: -H: -p List full paths. If this option is not specified, only the basename +H: -F List full paths. If this option is not specified, only the basename H: of each file is printed. +H: -p Synonym for -F. Deprecated. +H: +H: -b Print only the basename of each matching file. This is the default, so +H: the option is currently a no-op. It is recommended to specify this option, +H: though, as the default might change in a future release. H: H: -a List only files that are admissible with respect to the current mood or H: playlist. @@ -61,7 +66,8 @@ H: -r Reverse sort order. H: H: -d Print dates as seconds after the epoch. H: -H: -s=order Change sort order. Defaults to alphabetical path sort if not given. +H: -s=order +H: Change sort order. Defaults to alphabetical path sort if not given. H: H: Possible values for order: H: p: by path diff --git a/aft.c b/aft.c index f14440e6..df295246 100644 --- a/aft.c +++ b/aft.c @@ -1410,10 +1410,14 @@ int com_ls(struct command_context *cc) return -E_AFT_SYNTAX; } } - if (!strcmp(arg, "-p")) { + if (!strcmp(arg, "-p") || !strcmp(arg, "-F")) { flags |= LS_FLAG_FULL_PATH; continue; } + if (!strcmp(arg, "-b")) { + flags &= ~LS_FLAG_FULL_PATH; + continue; + } if (!strcmp(arg, "-a")) { flags |= LS_FLAG_ADMISSIBLE_ONLY; continue; diff --git a/client.c b/client.c index 31cfff09..64b15537 100644 --- a/client.c +++ b/client.c @@ -278,7 +278,7 @@ static void ls_completer(struct i9e_completion_info *ci, char *opts[] = { "--", "-l", "-l=s", "-l=l", "-l=v", "-l=p", "-l=m", "-l=c", "-p", "-a", "-r", "-d", "-s=p", "-s=l", "-s=s", "-s=n", "-s=f", - "-s=c", "-s=i", "-s=y", "-s=b", "-s=d", "-s=a", NULL + "-s=c", "-s=i", "-s=y", "-s=b", "-s=d", "-s=a", "-F", "-b", NULL }; if (ci->word[0] == '-') i9e_complete_option(opts, ci, cr);