summaryrefslogtreecommitdiff
path: root/Util/helpfiles
diff options
context:
space:
mode:
Diffstat (limited to 'Util/helpfiles')
-rwxr-xr-xUtil/helpfiles36
1 files changed, 11 insertions, 25 deletions
diff --git a/Util/helpfiles b/Util/helpfiles
index 900564842..699ca8321 100755
--- a/Util/helpfiles
+++ b/Util/helpfiles
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -- -*-perl-*-
+#!/usr/bin/env perl
# helpfiles: make help files for Z-shell builtins from the manual entries.
@@ -16,24 +16,10 @@
# If a third arg is given, the symlink is not created, but a
# list of symlinks is put into the file specified by that arg.
-# Example usage:
-# cd ~/zsh-4.0.1 # or wherever
-# mkdir Help
-# cd Help
-# man zshbuiltins | colcrt - | helpfiles
-# run-help() {
-# typeset zhelp=~/zsh-4.0.1/Help # or wherever
-# [[ $1 = . ]] && 1=dot
-# [[ $1 = : ]] && 1=colon
-# if [[ $1 = compctl ]]; then
-# man zshcompctl
-# elif [[ -f $zhelp/$1 ]]; then
-# ${=PAGER:-more} $zhelp/$1
-# else
-# man $1
-# fi
-# }
-# now <Esc>-h works for shell builtins.
+# This script is called automatically during `make install'
+# unless specified otherwise.
+
+# For usage and and more information see zshcontrib(1).
sub Usage {
print(STDERR "Usage: helpfiles zshbuiltins.1 dest-dir [link-file]\n");
@@ -81,17 +67,17 @@ if(system('man ' . $args) || !(-s $mantmp)) {
}
$args = "$mantmp >$coltmp";
unlink($coltmp);
-&Info('attempting colcrt ', $args);
-if(system('colcrt ' . $args) || !(-s $coltmp)) {
- unlink($coltmp);
- &Info('attempting col -bx <', $args);
+&Info('attempting col -bx <', $args);
# The x is necessary so that spaces don't turn into tabs, which messes
# up the calculations of indentation on machines which randomly wrap lines
# round to the previous line (so you see what we're up against).
- if(system('col -bx <' . $args) || !(-s $coltmp)) {
+if(system('col -bx <' . $args) || !(-s $coltmp)) {
+ unlink($coltmp);
+ &Info('attempting colcrt - ', $args);
+ if(system('colcrt - ' . $args) || !(-s $coltmp)) {
unlink($mantmp);
unlink($coltmp);
- &Die('colcrt and col -bx both failed');
+ &Die('col -bx and colcrt - both failed');
}
}
unlink($mantmp) || &Die('cannot remove tempfile ', $mantmp);