#!/usr/bin/perl -w # # ds: double-space the input. useful for stuff with long lines. # # 2007-??: Written by Steven J. DeRose. # 2008-05-05 sjd: Add -n. Getopt::Long. # # To do: # Make sure char encodings are ok # Offer 'wrap' functionality too? # Integrate with 'anycat'? # use strict; use Getopt::Long; our $VERSION = "2012-11-07"; my $n = 1; my $quiet = 0; my $verbose = 0; ############################################################################### # my %getoptHash = ( "h|help" => sub { system "perldoc $0"; exit; }, "n=i" => \$n, "q!" => \$quiet, "v+" => \$verbose, "version" => sub { die "Version of $VERSION by Steven J. DeRose.\n"; } ); Getopt::Long::Configure ("ignore_case"); GetOptions(%getoptHash) || die "Bad options.\n"; ############################################################################### ############################################################################### # Main # my $extraSep = "\n" x ($n + 1); while (<>) { print $_ . $extraSep; } exit; ############################################################################### ############################################################################### ############################################################################### # =pod =head1 Usage ds [options] Copies stdin to stdout, adding a blank line(s) after every line. By default it double-spaces the output. This is especially useful for program output that has many long messages, so you can see each individual message more clearly. =head1 Options =over =item * B<-n> I Put even more blank lines in (default = 1). =item * B<-q> Suppress most messages. =item * B<-v> Add more messages, and check integrity frequently. =item * B<-version> Display the version number, then exit. =back =head1 Ownership This work by Steven J. DeRose is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. For further information on this license, see L. The author's present email is sderose at acm.org. For the most recent version, see L. =cut