mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 19:03:38 +08:00
type: Print *only* the path if given --path or --force-path
This is what happens when you check your tests in the wrong tab, folks. Fixes #7345.
This commit is contained in:
parent
533957fc2e
commit
1188a12dfd
|
@ -187,7 +187,11 @@ maybe_t<int> builtin_type(parser_t &parser, io_streams_t &streams, wchar_t **arg
|
|||
++found;
|
||||
res = true;
|
||||
if (!opts.query && !opts.type) {
|
||||
streams.out.append_format(L"%ls is %ls\n", name, path.c_str());
|
||||
if (opts.path || opts.force_path) {
|
||||
streams.out.append_format(L"%ls\n", path.c_str());
|
||||
} else {
|
||||
streams.out.append_format(L"%ls is %ls\n", name, path.c_str());
|
||||
}
|
||||
} else if (opts.type) {
|
||||
streams.out.append(_(L"file\n"));
|
||||
break;
|
||||
|
|
|
@ -42,9 +42,9 @@ type -t realpath foobar
|
|||
# CHECKERR: type: Could not find {{.}}foobar{{.}}
|
||||
|
||||
type -P test
|
||||
# CHECK: test is {{.*}}/test
|
||||
# CHECK: {{/.*}}test
|
||||
type -P ls
|
||||
# CHECK: ls is {{.*}}/ls
|
||||
# CHECK: {{/.*}}ls
|
||||
|
||||
type
|
||||
echo $status
|
||||
|
|
Loading…
Reference in New Issue
Block a user