CAD-Firemen

 view release on metacpan or  search on metacpan

bin/fm_create_help  view on Meta::CPAN

  my %statistics = ();
  $statistics{"Options in cdb"} = buildStatistic("Options in cdb", $countOptions, $countOptions);
  $statistics{"Options in Help"} = buildStatistic("Options in Help", $foundOptionsInHelp, $countOptions);
  $statistics{"Default values"} = buildStatistic("Default values", scalar(keys(%optionsDefault)), $countOptionsDefaultValues);
  $statistics{"Descriptions"} = buildStatistic("Descriptions", scalar(keys(%optionsInfo)), $countOptions);

  my $maxLen = maxLength(keys(%statistics)) + 2;
  foreach my $stat (keys(%statistics)){
    print sprintf("%-". $maxLen ."s", $stat) . $statistics{$stat} ."\n";
  }
  print "Ignored ". $ignoredFs ." Options with value -Fs to calculate percentage of Default values\n";
}

END {
  if(defined($dbh) && ($dbh != 0) && !$dbh->disconnect){
    print "Could not disconnect from database!\n";
    print "Error: ". $DBI::errstr;
    exit 1;
  }
}

lib/CAD/Firemen/Common.pm  view on Meta::CPAN

  if(!defined($value)){
    return $result;
  }
  if(!defined($max) || ($max == 0)){
    return $result;
  }

  my $terminalWidth = _terminalWidth() - 2;
  my $relValue = sprintf("%.0f", $value / $max * 100);
  $label .= " [";
  # - 6 is the percent itself (e.g.: " 69%, ")
  my $valueLen = $terminalWidth - length($label) - 1 - 6 - length($value);
  if($valueLen > 100){
    $valueLen = 100;
  }
  my $signs = floor($valueLen * $relValue / 100);
  my $space = $valueLen - $signs;
  $result = "[";
  for(my $i = 0; $i < $signs; $i++){
    $result .= "=";
  }

lib/CAD/Firemen/Common.pm  view on Meta::CPAN


Prints the given text in the given color. The main reason to use this function is to
use Win32::Console within this module.

=head2 printBlock

Prints a text block with an specified indentation.

=head2 buildStatistic

Builds a bar of = to display a percentage value of the ratio between $value and $max.

=head2 getInstallationPath

Method parses $ENV{PATH} and tries to filter out all Firemen related paths.
Afterwards, if more than one is found, the user can select which one he wants
to use. This one is returned than.

The returned path DOES NOT ends with a slash!

=head2 getInstallationConfigCdb



( run in 0.400 second using v1.01-cache-2.11-cpan-709fd43a63f )