mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 06:41:14 -03:00
status get/list-files: fix minor bugs when compiled without embedded files (#11390)
* man: redirect stderr to /dev/null when checking for embedded files This fixes a bug where `man status` results in "status: fish was not built with embedded files⏎" printed. * fish_config and status completions: redirect stderr to /dev/null when checking for embedded files I am less sure about this commit, can get rid of it. * status get-file/list-files: add \n to error message when not compiled with embedded files
This commit is contained in:
@@ -71,5 +71,5 @@ complete -f -c status -n "__fish_seen_subcommand_from job-control" -a full -d "S
|
||||
complete -f -c status -n "__fish_seen_subcommand_from job-control" -a interactive -d "Set only interactive jobs under job control"
|
||||
complete -f -c status -n "__fish_seen_subcommand_from job-control" -a none -d "Set no jobs under job control"
|
||||
|
||||
complete -f -c status -n "__fish_seen_subcommand_from get-file" -a '(status list-files)'
|
||||
complete -f -c status -n "__fish_seen_subcommand_from list-files" -a '(status list-files)'
|
||||
complete -f -c status -n "__fish_seen_subcommand_from get-file" -a '(status list-files 2>/dev/null)'
|
||||
complete -f -c status -n "__fish_seen_subcommand_from list-files" -a '(status list-files 2>/dev/null)'
|
||||
|
||||
@@ -127,7 +127,7 @@ function fish_config --description "Launch fish's web based configuration"
|
||||
end
|
||||
end
|
||||
if not set -q have[1]
|
||||
if status list-files tools/web_config/sample_prompts/$argv[1].fish >/dev/null
|
||||
if status list-files tools/web_config/sample_prompts/$argv[1].fish &>/dev/null
|
||||
status get-file tools/web_config/sample_prompts/$argv[1].fish | source
|
||||
# HACK: `source` gives us a filename of "-", so we check manually if we had a right prompt
|
||||
set have ""
|
||||
@@ -170,7 +170,7 @@ function fish_config --description "Launch fish's web based configuration"
|
||||
end
|
||||
end
|
||||
if not set -q have[1]
|
||||
if status list-files tools/web_config/sample_prompts/$argv[1].fish >/dev/null
|
||||
if status list-files tools/web_config/sample_prompts/$argv[1].fish &>/dev/null
|
||||
status get-file tools/web_config/sample_prompts/$argv[1].fish | source
|
||||
else
|
||||
echo "No such prompt: '$argv[1]'" >&2
|
||||
@@ -303,7 +303,7 @@ function fish_config --description "Launch fish's web based configuration"
|
||||
end
|
||||
|
||||
if not set -q file[1]
|
||||
if status list-files tools/web_config/themes/$argv[1].theme >/dev/null
|
||||
if status list-files tools/web_config/themes/$argv[1].theme &>/dev/null
|
||||
set file tools/web_config/themes/$argv[1].theme
|
||||
else
|
||||
echo "No such theme: $argv[1]" >&2
|
||||
|
||||
@@ -53,7 +53,7 @@ function man --description "Format and display the on-line manual pages"
|
||||
end
|
||||
end
|
||||
|
||||
if not set -q argv[2] && status list-files "man/man1/$argv[1].1" >/dev/null
|
||||
if not set -q argv[2] && status list-files "man/man1/$argv[1].1" &>/dev/null
|
||||
__fish_print_help $argv
|
||||
return
|
||||
end
|
||||
|
||||
@@ -474,7 +474,7 @@ pub fn status(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> B
|
||||
}
|
||||
#[cfg(not(feature = "embed-data"))]
|
||||
{
|
||||
streams.err.append(wgettext_fmt!(
|
||||
streams.err.appendln(wgettext_fmt!(
|
||||
"%ls: fish was not built with embedded files",
|
||||
cmd,
|
||||
));
|
||||
@@ -520,7 +520,7 @@ pub fn status(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> B
|
||||
}
|
||||
#[cfg(not(feature = "embed-data"))]
|
||||
{
|
||||
streams.err.append(wgettext_fmt!(
|
||||
streams.err.appendln(wgettext_fmt!(
|
||||
"%ls: fish was not built with embedded files",
|
||||
cmd,
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user