aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--share/functions/_.fish2
-rw-r--r--share/functions/__fish_print_packages.fish6
-rw-r--r--share/functions/help.fish6
-rw-r--r--share/functions/type.fish2
4 files changed, 8 insertions, 8 deletions
diff --git a/share/functions/_.fish b/share/functions/_.fish
index a1404761..accfdcbc 100644
--- a/share/functions/_.fish
+++ b/share/functions/_.fish
@@ -3,7 +3,7 @@
# Alias for gettext (or a fallback if gettext isn't installed)
#
-if test -x (which gettext) ^/dev/null >/dev/null
+if type -f gettext >/dev/null
function _ -d "Alias for the gettext command"
gettext fish $argv
end
diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish
index 5c56a223..77a7da25 100644
--- a/share/functions/__fish_print_packages.fish
+++ b/share/functions/__fish_print_packages.fish
@@ -12,7 +12,7 @@ function __fish_print_packages
#Get the word 'Package' in the current language
set -l package (_ Package)
- if which apt-cache >/dev/null ^/dev/null
+ if type -f apt-cache >/dev/null
# Apply the following filters to output of apt-cache:
# 1) Remove package names with parentesis in them, since these seem to not correspond to actual packages as reported by rpm
# 2) Remove package names that are .so files, since these seem to not correspond to actual packages as reported by rpm
@@ -25,7 +25,7 @@ function __fish_print_packages
# Rpm is too slow for this job, so we set it up to do completions
# as a background job and cache the results.
- if which rpm >/dev/null ^/dev/null
+ if type -f rpm >/dev/null
# If the cache is less than five minutes old, we do not recalculate it
@@ -46,7 +46,7 @@ function __fish_print_packages
# This completes the package name from the portage tree.
# True for installing new packages. Function for printing
# installed on the system packages is in completions/emerge.fish
- if which emerge >/dev/null ^/dev/null
+ if type -f emerge >/dev/null
emerge -s \^(commandline -tc) |grep "^*" |cut -d\ -f3 |cut -d/ -f2
return
end
diff --git a/share/functions/help.fish b/share/functions/help.fish
index ae5aa0a4..5707f4f2 100644
--- a/share/functions/help.fish
+++ b/share/functions/help.fish
@@ -36,7 +36,7 @@ function help -d (N_ "Show help for the fish shell")
else
# Check for a text-based browser.
for i in $text_browsers
- if which $i 2>/dev/null >/dev/null
+ if type -f $i >/dev/null
set fish_browser $i
break
end
@@ -46,7 +46,7 @@ function help -d (N_ "Show help for the fish shell")
# browser to use instead.
if test "$DISPLAY" -a \( "$XAUTHORITY" = "$HOME/.Xauthority" -o "$XAUTHORITY" = "" \)
for i in $graphical_browsers
- if which $i 2>/dev/null >/dev/null
+ if type -f $i >/dev/null
set fish_browser $i
set fish_browser_bg 1
break
@@ -79,7 +79,7 @@ function help -d (N_ "Show help for the fish shell")
case $help_topics
set fish_help_page "index.html\#$fish_help_item"
case "*"
- if which $fish_help_item >/dev/null ^/dev/null
+ if type -f $fish_help_item >/dev/null
man $fish_help_item
return
end
diff --git a/share/functions/type.fish b/share/functions/type.fish
index 4b48c122..f8454847 100644
--- a/share/functions/type.fish
+++ b/share/functions/type.fish
@@ -119,7 +119,7 @@ function type -d (N_ "Print the type of a command")
printf (_ 'file\n')
case path
- which $i
+ echo $path
end
if test $selection != multi
continue