2011-07-09 Tim Retout <diocles@gnu.org>
+ Apply patch 393791-sliceprint from Debian:
+ * scripts/sliceprint.1: Complete documentation.
+ * scripts/sliceprint.in: Force C locale.
+ Use more liberal regexp when parsing wrapped lines message.
+ Add missing space from before args. Savannah bug #31259.
+
* Makefile.am (SUBDIRS): Move intl to be built before compat.
* states/Makefile.am: Use $(datadir) instead of $(prefix)/share.
sliceprint \- slice documents with long lines.
.SH SYNOPSIS
-.B sliceprint \f1[\f2enscript_options\f1]\f3 \f1[\f2files\f1]\f3
+.B sliceprint \f1[\-o\f2file\f1]\f3 \f1[\f2enscript_options\f1]\f3 \f1[\f2files\f1]\f3
.SH DESCRIPTION
-XXX
-
+\f3Sliceprint\f1 is a wrapper around the \f3enscript(1)\f1\ \-\-slice option.
+Output slices are written to \f2file\f1.1, \f2file\f1.2 and so on.
.SH SEE ALSO
enscript(1)
#
$enscript = "enscript";
+$ENV{LC_ALL} = "C"; # we parse enscript's output
$program = $0;
$program =~ s/.*\///g;
sub usage {
- warn "Usage: $program [ENSCRIPT_OPTION]... [FILE]...\n";
+ warn "Usage: $program [-oFILE] [ENSCRIPT_OPTION]... [FILE]...\n";
}
# Handle arguments.
while (1) {
$slice++;
if (defined($output_file)) {
- $cmd = "$enscript" . $args . " --slice=$slice -p"
+ $cmd = "$enscript " . $args . " --slice=$slice -p"
. $output_file . "." . $slice . " " . $files;
} else {
- $cmd = "$enscript" . $args . " --slice=$slice" . $files;
+ $cmd = "$enscript " . $args . " --slice=$slice" . $files;
}
print "printing slice $slice...\n";
$result = `$cmd 2>&1`;
- if ($result !~ ".*lines were.*") {
+ print $result;
+ if ($result !~ ".*line.* were wrapped.*") {
last;
}
}