#!/usr/bin/perl -w
#
# dbcolneaten.pm
# Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu>
#
# This program is distributed under terms of the GNU general
# public license, version 2. See the file COPYING
# in $dblibdir for details.
#
=head1 NAME
dbcolneaten - pretty-print columns of Fsdb data (assuming a monospaced font)
=head1 SYNOPSIS
dbcolneaten [-E] [field_settings]
=head1 DESCRIPTION
L<dbcolneaten> arranges that the Fsdb data appears in
neat columns if you view it with a monospaced font.
To do this, it pads out each field with spaces to line up
the next field.
Field settings are of the form
field op value
OP is >=, =, or <= specifying that the width of
that FIELD must be more, equal, or less than that VALUE
L<dbcolneaten> runs in O(1) memory but disk space proportional to the
size of data.
=head1 OPTIONS
=over 4
=item B<-E> or B<--noeoln>
Omit padding for the last column (at the end-of-the-line).
(Default behavior.)
=item B<-e> or B<--eoln>
Do padding and include an extra field separator after the last column.
(Useful if you're interactively adding a column.)
=back
=for comment
begin_standard_fsdb_options
This module also supports the standard fsdb options:
=over 4
=item B<-d>
Enable debugging output.
=item B<-i> or B<--input> InputSource
Read from InputSource, typically a file name, or C<-> for standard input,
or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
=item B<-o> or B<--output> OutputDestination
Write to OutputDestination, typically a file name, or C<-> for standard output,
or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
=item B<--autorun> or B<--noautorun>
By default, programs process automatically,
but Fsdb::Filter objects in Perl do not run until you invoke
the run() method.
The C<--(no)autorun> option controls that behavior within Perl.
=item B<--help>
Show help.
=item B<--man>
Show full manual.
=back
=for comment
end_standard_fsdb_options
=head1 SAMPLE USAGE
=head2 Input:
#fsdb fullname homedir uid gid
Mr._John_Heidemann_Junior /home/johnh 2274 134
Greg_Johnson /home/greg 2275 134
Root /root 0 0
# this is a simple database
# | dbcol fullname homedir uid gid
=head2 Command:
dbcolneaten
=head2 Output:
#fsdb -F s fullname homedir uid gid
Mr._John_Heidemann_Junior /home/johnh 2274 134
Greg_Johnson /home/greg 2275 134
Root /root 0 0
# this is a simple database
# | dbcol fullname homedir uid gid
# | dbcolneaten
=head1 BUGS
Does not handle tab separators correctly.
=head1 SEE ALSO
L<Fsdb>.
=cut
# WARNING: This code is derived from dbcolneaten.pm; that is the master copy.
use Fsdb::Filter::dbcolneaten;
my $f = new Fsdb::Filter::dbcolneaten(@ARGV);
$f->setup_run_finish; # or could just --autorun
exit 0;
=head1 AUTHOR and COPYRIGHT
Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu>
This program is distributed under terms of the GNU general
public license, version 2. See the file COPYING
with the distribution for details.
=cut
1;