Changeset 296


Ignore:
Timestamp:
Jul 18, 2018, 12:20:18 PM (6 years ago)
Author:
g7moreau
Message:
  • Try a table
Location:
trunk/ddt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ddt/ddt

    r295 r296  
    44# License GNU GPL version 2 or later and Perl equivalent
    55#
    6 # apt-get install perl-base perl-modules libyaml-syck-perl libnet-netmask-perl libreadonly-perl libfile-touch-perl
     6# apt-get install perl-base perl-modules libyaml-syck-perl libnet-netmask-perl libreadonly-perl libfile-touch-perl libtext-table-perl
    77
    88package DDT::RE;
     
    3030use File::Copy;
    3131use Socket;
     32use Text::Table;
    3233
    3334my $command = shift @ARGV || 'help';
     
    22682269      next if $domainset_current eq 'version';
    22692270
    2270       print "\n# *** List of pool computers in the domain set: $domainset_current ***\n";
    2271       printf "%-30s  %-20s %17s %5s %7s %-10s %s\n",
    2272          'Hostname',
    2273          'IPv4-Address',
    2274          'MAC-Address',
    2275          'Type',
    2276          'Status',
    2277          'Date',
    2278          'Comment';
     2271      my $tb_computer = Text::Table->new(
     2272         {align => 'left',   align_title => 'left',   title => 'Hostname.DomainSet'},
     2273         {align => 'left',   align_title => 'left',   title => 'IPv4-Address'},
     2274         {align => 'center', align_title => 'center', title => 'MAC-Address'},
     2275         {align => 'right',  align_title => 'right',  title => 'Type'},
     2276         {align => 'right',  align_title => 'right',  title => 'Status'},
     2277         {align => 'left',   align_title => 'left',   title => 'Date'},
     2278         {align => 'left',   align_title => 'left',   title => 'Comment'},
     2279         );
     2280
     2281      $tb_computer->add(
     2282
     2283      #printf "%-30s  %-20s %17s %5s %7s %-10s %s\n",
     2284      #   'Hostname',
     2285      #   'IPv4-Address',
     2286      #   'MAC-Address',
     2287      #   'Type',
     2288      #   'Status',
     2289      #   'Date',
     2290      #   'Comment';
    22792291      my @domainsetdb = @{$computer_db->{$domainset_current}};
    22802292
     
    23142326            }
    23152327
    2316          printf "%-30s  %-20s %17s %9s %3s %10s %s\n",
     2328         #printf "%-30s  %-20s %17s %9s %3s %10s %s\n",
     2329         $tb_computer->add(
    23172330            $attribute->{'hostname'} . '.' . $domainset_current,
    23182331            $ip,
     
    23212334            $enable,
    23222335            $date,
    2323             $comment;
    2324          }
     2336            $comment,
     2337            );
     2338         }
     2339
     2340      print "\n# *** List of pool computers in the domain set: $domainset_current ***\n";
     2341      print $tb_computer->title();
     2342      print $tb_computer->rule('-');
     2343      print $tb_computer->body();
    23252344      }
    23262345
  • trunk/ddt/make-package-debian

    r253 r296  
    4343Tag: implemented-in::perl, interface::commandline, role::program
    4444Priority: optional
    45 Depends: perl, perl-base, perl-modules, libyaml-syck-perl, libnet-netmask-perl, libreadonly-perl, libfile-touch-perl
     45Depends: perl, perl-base, perl-modules, libyaml-syck-perl, libnet-netmask-perl, libreadonly-perl, libfile-touch-perl, libtext-table-perl
    4646Suggests: libyaml-shell-perl | yamllint, perl-doc, isc-dhcp-server, bind9
    4747Architecture: all
Note: See TracChangeset for help on using the changeset viewer.