Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: run-help: Support for svn and git



On Jan 3, 11:32pm, Clint Adams wrote:
} Subject: Re: run-help: Support for svn and git
}
} With this I can just
} sed 's,^# HELPDIR should be.*,: ${HELPDIR:=/usr/share/zsh/help},;s,:-more,:-/usr/bin/pager,' Functions/Misc/run-help
} 
} Better ideas are welcome.

Not having a Debian install available anywhere, I'm not sure what
/usr/bin/pager does.  Is there a reason you can't simply assign to
$PAGER in /etc/z* as well?  With appropriate checks that it isn't
already set to something else, of course.
 
Then, how about this?  It's not really a problem to have a default
value of HELPDIR in the function, since we check that it exists.  I
suppose if someone wanted to explicitly turn OFF the use of HELPDIR,
this would be a problem ... is that worth worrying about?

Also, would /usr/share/zsh/$ZSH_VERSION/help be more appropriate?

Index: Functions/Misc/run-help
===================================================================
diff -c -r1.3 run-help
--- Functions/Misc/run-help	30 May 2007 03:36:56 -0000	1.3
+++ Functions/Misc/run-help	5 Jan 2008 17:38:35 -0000
@@ -11,13 +11,15 @@
 emulate -R zsh
 setopt localoptions
 
+local HELPDIR="${HELPDIR:-/usr/share/zsh/help}"
+
 [[ $1 == "." ]] && 1="dot"
 [[ $1 == ":" ]] && 1="colon"
 
 # Check whether Util/helpfiles has been used to generate zsh help
 if [[ $# == 0 || $1 == "-l" ]]
 then
-    if [[ -n "${HELPDIR:-}" && -d $HELPDIR ]]
+    if [[ -d $HELPDIR ]]
     then
 	echo "Here is a list of topics for which special help is available:"
 	echo ""



Messages sorted by: Reverse Date, Date, Thread, Author