summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-03-21 23:26:14 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-03-21 23:28:08 +0100
commit7c0c6369b9c047db553ce81be0cd5530bbaee046 (patch)
treebf2c49856cb11b20663f2d2f385af2e7626b5618 /etc
parent8c7e64e5f1a8764a0376d54b5db0a0ce31b6856c (diff)
Added help function
Diffstat (limited to 'etc')
-rwxr-xr-xetc/functions/help15
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/functions/help b/etc/functions/help
new file mode 100755
index 0000000..b29130e
--- /dev/null
+++ b/etc/functions/help
@@ -0,0 +1,15 @@
+## vim:ft=zsh
+## wrapper around man, finfo, etc
+
+if man -w $1 &> /dev/null; then
+ man $1
+elif [[ -n $(whichf $1) ]]; then
+ finfo $1
+elif (( ${+builtins[$1]} )); then
+ man zshbuiltins | less -p " $1"
+elif check_com -c $1 && check_com -c apt-file; then
+ apt-cache show ${(s/:/)$(apt-file search -F $commands[$1])[1]}
+else
+ echo "Sorry, no clue." >&2
+ return 1
+fi