build floating point type report

This commit is contained in:
hamidrezanorouzi 2022-10-01 19:16:33 +03:30
parent 77408f16af
commit 9e955fa11e
3 changed files with 15 additions and 4 deletions

View File

@ -36,10 +36,11 @@ pFlow::commandLine::commandLine(word appName, word disptn)
{
CLI::App::add_flag_callback(
"--discription",
"--description",
[disptn, appName]() {
output<<"\n"<<yellowText(versoinCopyright)<<endl<<endl;
output<<"Discription for "<< boldText(appName)<<":\n";
output<<"\n"<<yellowText(versoinCopyright)<<endl;
output<<yellowText(floatingPointDescription())<<endl<<endl;
output<<"Description for "<< boldText(appName)<<":\n";
output<<" "<<disptn<<endl;
},
"What does this app do?"
@ -52,7 +53,7 @@ bool pFlow::commandLine::parse(
{
try {
CLI::App::parse(argc, argv);
if(CLI::App::count("--discription")) return false;
if(CLI::App::count("--description")) return false;
return true;
} catch(const ParseError &e) {
CLI::App::exit(e);

View File

@ -30,10 +30,13 @@ namespace pFlow
#ifdef pFlow_Build_Double
#define useDouble 1
inline const char* floatingPointType__ = "double";
#else
#define useDouble 0
inline const char* floatingPointType__ = "float";
#endif
// scalars
#if useDouble
using real = double;
@ -57,6 +60,12 @@ using label = std::size_t;
using word = std::string;
inline
auto floatingPointDescription()
{
return word("In this build, ") + word(floatingPointType__) +
word(" is used for floating point operations.");
}
} // end of pFlow

View File

@ -41,6 +41,7 @@ if(!cmds.parse(argc, argv)) return 0;
output<<endl;
Report(1)<< "You are using "<<yellowText(cmds.productNameCopyright())<<endReport;
Report(1)<< yellowText(pFlow::floatingPointDescription())<<endReport;
// this should be palced in each main