CAD-Firemen
view release on metacpan or search on metacpan
bin/fm_create_help view on Meta::CPAN
strip
sharedDir
dbConnect
buildStatistic
);
use CAD::Firemen::Load qw(loadCDB);
use CAD::Firemen::ParseHelp::Wildfire5 qw(extractHelpWildfire5);
use CAD::Firemen::ParseHelp::Creo3 qw(extractHelpCreo3);
sub localeToLang {
my $locale = shift;
if(!defined($locale) || $locale eq ""){
return "";
}
my %languages = ("en_US" => "usascii", "de_DE" => "german");
if(exists($languages{$locale})){
return $languages{$locale};
}
return "";
}
our $locale = "en_US";
our $zipUrl = "";
our $tocUrl = "";
sub findHelpUrls{
my $file = $File::Find::name;
my $regex = "(?:\|/)(?:pma|proe)_help_". substr($locale, 0, 2) .".zip\$";
if(($zipUrl eq "") && ($file =~ m/$regex/i)){
$zipUrl = $file;
testPassed("Found help archive (". $zipUrl .")");
}
elsif($tocUrl eq ""){
$regex = "toc/". $locale .".xml\$";
if($file =~ m/$regex/i){
$tocUrl = $file;
testPassed("Found help toc (". $tocUrl .")");
}
else{
my $language = localeToLang($locale);
if($language ne ""){
$regex = "(?:\|/)". $language ."/pma_sx.js\$";
if(($tocUrl eq "") && ($file =~ m/$regex/i)){
my ($name, $path, $suffix) = fileparse($file);
$tocUrl = File::Spec->canonpath( $path ."/../../");
testPassed("Found help in creo 3 format (". $tocUrl .")");
$zipUrl = "";
}
}
}
bin/fm_create_help view on Meta::CPAN
my $outputFile = "";
my $crossfire = 0;
my $notepad = 0;
my $dbh = undef;
Getopt::Long::Configure ("bundling", "auto_help");
if(!GetOptions(
'version' => \$showVersion,
'verbose|v:i' => \$verbose,
'output|o:s' => \$outputFile,
'locale|l:s' => \$locale,
'crossfire|c' => \$crossfire,
'notepad|n' => \$notepad
)){
pod2usage(2);
}
if($showVersion){
CAD::Firemen::printVersion();
}
my $structUrl = shift;
if(!defined($structUrl)){
$structUrl = getInstallationPath();
}
if(!defined($structUrl) || $structUrl eq ""){
pod2usage(2);
}
if($locale !~ m/[a-z]{2}_[A-Z]{2}/){
print "Please specify a valid locale like en_US\n";
help();
exit 1;
}
if($crossfire && $outputFile eq ""){
print "Please specify an output file with help of --output\n";
pod2usage(2);
}
if($notepad && !-d $outputFile){
bin/fm_create_help view on Meta::CPAN
my %optionsDefault = ();
my %errors = ();
if($zipUrl ne ""){
my ($optionsInfoRef, $optionsValueRef, $optionsDefaultRef, $errorsRef) = extractHelpWildfire5($tocUrl, "", \%cdbOptions, $verbose, $zipUrl);
%optionsInfo = %{$optionsInfoRef};
%optionsValue = %{$optionsValueRef};
%optionsDefault = %{$optionsDefaultRef};
%errors = %{$errorsRef};
}
else{
my ($optionsInfoRef, $optionsValueRef, $optionsDefaultRef, $errorsRef) = extractHelpCreo3($tocUrl, localeToLang($locale), \%cdbOptions, $verbose);
%optionsInfo = %{$optionsInfoRef};
%optionsValue = %{$optionsValueRef};
%optionsDefault = %{$optionsDefaultRef};
%errors = %{$errorsRef};
}
my $foundOptionsInHelp = scalar(keys(%optionsInfo));
if(scalar(keys(%errors)) > 0){
print2ColsRightAligned("Collecting infos ", scalar(keys(%errors)) ." errors", "yellow");
if($verbose > 0){
bin/fm_create_help view on Meta::CPAN
=head1 SYNOPSIS
fm_create_help [options] [PATH_TO_INSTALLATION]
Options:
--help -? Prints this help.
--version Prints current version.
--verbose -v The verbose level. 0 - least output, 2 most output (Default: 0).
--output -o Optional filepath to store the created data.
--locale -l The locale which should be used (Default en_US).
--crossfire -c Store the output in the format of Crossfire. Set file with --output.
--notepad -n Create some Notepad++ help files. Set directory with --output.
If no PATH_TO_INSTALLATION is given, it tries to figure out the correct path with help of $ENV{PATH}.
Example:
fm_create_help
=head1 DESCRIPTION
lib/CAD/Firemen.pm view on Meta::CPAN
fm_diff_config allows you to analyze two config files and displays added, removed and changed options.
This command can also be used to display changes of default values between to releases (see it's help).
The command fm_check_config checks, that all option listed in given config are also known
by the specified release. To complete the checks before releasing a new version of the config files
use fm_check_struct, which checks a whole tree of files and directories, to make sure, that all referenced
files within the config.pro are at there position (relative to the config.pro path). It also runs the same
checks like fm_check_config does.
All scripts are much more usefull, if you create a database first, which contains options, their values
and default value. Firemen provides the script fm_create_help, to create such a database. To create it,
it uses the html help, so please make sure, that you have installed it in your wanted locale. Afterwards,
you can use -d at all scripts to get more extended infos about displayed options.
To create an options database:
fm_create_help -l de_DE
Compare all available options:
fm_diff_cdb PATH_TO_DATABSE_1.CDB PATH_TO_DATABSE_2.CDB
( run in 2.075 seconds using v1.01-cache-2.11-cpan-ceb78f64989 )