mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 10:51:15 -03:00
Restore previous output of status current-{filename,function}
Closes #4499.
Partial reversion of 30368d5526.
This commit is contained in:
@@ -42,7 +42,8 @@ The following operations (sub-commands) are available:
|
|||||||
|
|
||||||
- `filename` prints the filename of the currently running script. Also `current-filename`, `-f` or `--current-filename`.
|
- `filename` prints the filename of the currently running script. Also `current-filename`, `-f` or `--current-filename`.
|
||||||
|
|
||||||
- `function` prints the name of the currently called function if able, when missing displays "N/A". Also `current-function`, `-u` or `--current-function`.
|
- `function` prints the name of the currently called function if able, when missing displays "Not a
|
||||||
|
function" (or equivalent translated string). Also `current-function`, `-u` or `--current-function`.
|
||||||
|
|
||||||
- `line-number` prints the line number of the currently running script. Also `current-line-number`, `-n` or `--current-line-number`.
|
- `line-number` prints the line number of the currently running script. Also `current-line-number`, `-n` or `--current-line-number`.
|
||||||
|
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ int builtin_status(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||||||
CHECK_FOR_UNEXPECTED_STATUS_ARGS(opts.status_cmd)
|
CHECK_FOR_UNEXPECTED_STATUS_ARGS(opts.status_cmd)
|
||||||
const wchar_t *fn = parser.current_filename();
|
const wchar_t *fn = parser.current_filename();
|
||||||
|
|
||||||
if (!fn) fn = _(L"stdin");
|
if (!fn) fn = _(L"Standard input");
|
||||||
streams.out.append_format(L"%ls\n", fn);
|
streams.out.append_format(L"%ls\n", fn);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -317,7 +317,7 @@ int builtin_status(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||||||
CHECK_FOR_UNEXPECTED_STATUS_ARGS(opts.status_cmd)
|
CHECK_FOR_UNEXPECTED_STATUS_ARGS(opts.status_cmd)
|
||||||
const wchar_t *fn = parser.get_function_name(opts.level);
|
const wchar_t *fn = parser.get_function_name(opts.level);
|
||||||
|
|
||||||
if (!fn) fn = _(L"N/A");
|
if (!fn) fn = _(L"Not a function");
|
||||||
streams.out.append_format(L"%ls\n", fn);
|
streams.out.append_format(L"%ls\n", fn);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
N/A
|
Not a function
|
||||||
test_function
|
test_function
|
||||||
test_function
|
test_function
|
||||||
|
|||||||
Reference in New Issue
Block a user