aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_print_help.fish
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-09-01 02:14:13 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-09-01 02:14:13 -0700
commitde5223db66ba36001020f7b3c2acda4303b927b3 (patch)
tree5f8b5cdf5d8975927e602337065e96fccf12af51 /share/functions/__fish_print_help.fish
parentcc1395797e78a26583461333199181b4f8ec0b13 (diff)
Improve documentation and error reporting for elseif.
Diffstat (limited to 'share/functions/__fish_print_help.fish')
-rw-r--r--share/functions/__fish_print_help.fish7
1 files changed, 6 insertions, 1 deletions
diff --git a/share/functions/__fish_print_help.fish b/share/functions/__fish_print_help.fish
index 1ea7393d..07df075c 100644
--- a/share/functions/__fish_print_help.fish
+++ b/share/functions/__fish_print_help.fish
@@ -8,6 +8,11 @@ function __fish_print_help --description "Print help message for the specified f
case '*'
set item $argv[1]
end
+
+ # Do nothing if the file does not exist
+ if not test -e "$__fish_datadir/man/man1/$item.1"
+ return
+ end
# These two expressions take care of underlines (Should be italic)
set -l cmd1 s/_\x08'\(.\)'/(set_color --underline)\\1(set_color normal)/g
@@ -32,4 +37,4 @@ function __fish_print_help --description "Print help message for the specified f
# Filter and print help
printf "%s\n" $help| tail -n (expr $lines - 5) | head -n (expr $lines - 8) | sed $sed_cmd
-end \ No newline at end of file
+end