From a04f31c5c04cc6768b31bc2867dcb753ba393bc8 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 9 Jul 2012 18:46:14 -0700 Subject: Fix for https://github.com/fish-shell/fish-shell/issues/218 make help smarter on OS X (don't show useless builtin man page) --- share/functions/help.fish | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/functions/help.fish b/share/functions/help.fish index 4e7179a3..6d10236a 100644 --- a/share/functions/help.fish +++ b/share/functions/help.fish @@ -76,7 +76,7 @@ function help --description "Show help for the fish shell" return 1 end - set fish_help_item $argv[1] + set -l fish_help_item $argv[1] switch "$fish_help_item" case "" @@ -98,7 +98,14 @@ function help --description "Show help for the fish shell" set fish_help_page "index.html\#$fish_help_item" case "*" if type -f $fish_help_item >/dev/null - man $fish_help_item + # Prefer to use fish's man pages, to avoid + # the annoying useless "builtin" man page bash + # installs on OS X + set -l man_arg "$__fish_datadir/man/man1/$fish_help_item.1" + if test ! -f "$man_arg" + set man_arg $fish_help_item + end + man $man_arg return end set fish_help_page "index.html" -- cgit v1.2.3