Commit 805a6256 authored by Romain Pacanowski's avatar Romain Pacanowski

Added --verbose command line option to output more information about in and out parametrization

if the user/developer wants it.

Minor changes:
 * Printing the output of the input dimensions
 * Using EXIT_FAILURE and EXIT_SUCCESS as returned values
parent 1e37ad16
......@@ -110,20 +110,20 @@ int main(int argc, char** argv)
std::cout << "Helps:" << std::endl;
std::cout << " --help Display this help." << std::endl;
std::cout << " --help-params Display the available input parametrizations." << std::endl;
return 0 ;
return EXIT_SUCCESS;
}
if(args.is_defined("help-params")) {
params::print_input_params();
return 0;
return EXIT_SUCCESS;
}
if(! args.is_defined("input")) {
std::cerr << "<<ERROR>> the input filename is not defined" << std::endl ;
return 1 ;
std::cerr << "<<ERROR>> The input filename is not defined" << std::endl ;
return EXIT_FAILURE;
}
if(! args.is_defined("output")) {
std::cerr << "<<ERROR>> the output filename is not defined" << std::endl ;
return 1 ;
std::cerr << "<<ERROR>> The output filename is not defined" << std::endl ;
return EXIT_FAILURE;
}
/*
if(! args.is_defined("out-data")) {
......@@ -144,7 +144,7 @@ int main(int argc, char** argv)
if(!d_in)
{
std::cout << "<<INFO>> input data will be treated as ALTA format" << std::endl;
std::cout << "<<INFO>> Input data will be treated as ALTA format" << std::endl;
}
ptr<data> d_out = plugins_manager::get_data(args["out-data"],
......@@ -153,27 +153,34 @@ int main(int argc, char** argv)
args) ;
if(!d_out)
{
std::cout << "<<INFO>> data will be outputed to ALTA format" << std::endl;
std::cout << "<<INFO>> Data will be outputed to ALTA format" << std::endl;
}
if(!d_in || !d_out)
{
std::cerr << "<<ERROR>> cannot import or export data" << std::endl ;
return 1;
std::cerr << "<<ERROR>> Cannot import or export data" << std::endl ;
return EXIT_FAILURE;
}
std::cout << "<<INFO>> conversion from " << params::get_name(d_in->parametrization().input_parametrization())
<< " to " << params::get_name(d_out->parametrization().input_parametrization()) << std::endl;
std::cout << "<<INFO>> Conversion from " << params::get_name(d_in->parametrization().input_parametrization())
<< " to " << params::get_name(d_out->parametrization().input_parametrization()) << std::endl;
std::cout << "<<INFO>> Input Dimensions for [X,Y] = " << d_in->parametrization().dimX()
<< ", " << d_in->parametrization().dimY() << std::endl;
if(dynamic_pointer_cast<vertical_segment>(d_out) || args.is_defined("splat"))
{
std::cout << "<<INFO>> output DIM = " << d_out->parametrization().dimX() << ", " << d_out->parametrization().dimY() << std::endl;
std::cout << "<<INFO>> Output Dimensions for [X,Y] = " << d_out->parametrization().dimX() << ", " << d_out->parametrization().dimY() << std::endl;
std::cout << " d_in->parametrization().input_parametrization(), = " << params::get_name(d_in->parametrization().input_parametrization() ) << std::endl;
std::cout << " d_in->parametrization().output_parametrization(), = " << params::get_name( d_in->parametrization().output_parametrization() ) << std::endl;
std::cout << " d_out->parametrization().dimY() = " << d_out->parametrization().dimY() << std::endl;
std::cout << "d_out->parametrization().output_parametrization() = " << params::get_name( d_out->parametrization().output_parametrization() ) << std::endl;
std::cout << " d_out->parametrization().input_parametrization(), = " << params::get_name( d_out->parametrization().input_parametrization() ) << std::endl;
if(args.is_defined("verbose"))
{
std::cout << "<<DEBUG>> d_in->parametrization().input_parametrization(), = " << params::get_name(d_in->parametrization().input_parametrization() ) << std::endl;
std::cout << "<<DEBUG>> d_in->parametrization().output_parametrization(), = " << params::get_name( d_in->parametrization().output_parametrization() ) << std::endl;
std::cout << "<<DEBUG>> d_out->parametrization().input_parametrization(), = " << params::get_name( d_out->parametrization().input_parametrization() ) << std::endl;
std::cout << "<<DEBUG>> d_out->parametrization().output_parametrization() = " << params::get_name( d_out->parametrization().output_parametrization() ) << std::endl;
}
unsigned int nb_invalid_configs = 0;
vec temp(d_out->parametrization().dimX() + d_out->parametrization().dimY());
......@@ -206,7 +213,7 @@ int main(int argc, char** argv)
if( nb_invalid_configs > 0 )
{
std::cout << " nb_invalid_configs = " << nb_invalid_configs << " over " << d_in->size() << " configs" << std::endl;
std::cout << "<<INFO>> nb_invalid_configs = " << nb_invalid_configs << " over " << d_in->size() << " configs" << std::endl;
}
}
......@@ -272,5 +279,5 @@ int main(int argc, char** argv)
}
d_out->save(args["output"]);
return 0 ;
return EXIT_SUCCESS;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment