In v0.6.0 the -p option will have the same meaning as for the rm and
touch commands: perform pathname match. Also the default for the ls
command will be changed to list full paths while the new -b option
must be given to print only the basename (i.e., the current behaviour
if -p is not given).
This commit is a preparation for these incompatible changes which
does not break existing scripts. It does the following
* The -p option is deprecated in favor of its synonym, the new -F
option (for full path).
* The new -b option instructs the command to perform basename matching
and print only the basename of the matching files. It is currently
a no-op.
With the patch applied, scripts are supposed to specify either -b or
-F as appropriate. In v0.6.0 the semantics of -p will be changed as
described above, the default will be changed to print the full path,
and -F will be deprecated because it is a no-op then.
H: m: mbox listing mode
H: c: chunk-table listing mode
H:
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: 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.
H:
H: -a List only files that are admissible with respect to the current mood or
H: playlist.
H:
H: -d Print dates as seconds after the epoch.
H:
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
H:
H: Possible values for order:
H: p: by path
return -E_AFT_SYNTAX;
}
}
return -E_AFT_SYNTAX;
}
}
- if (!strcmp(arg, "-p")) {
+ if (!strcmp(arg, "-p") || !strcmp(arg, "-F")) {
flags |= LS_FLAG_FULL_PATH;
continue;
}
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;
if (!strcmp(arg, "-a")) {
flags |= LS_FLAG_ADMISSIBLE_ONLY;
continue;
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",
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);
};
if (ci->word[0] == '-')
i9e_complete_option(opts, ci, cr);