Commit 9c6b97c4 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Add a show params to files

parent ac4a7f0e
......@@ -57,6 +57,11 @@ static const FParameterNames DateHost = {
"To have to print the current host and the execution date."
};
static const FParameterNames UserParams = {
{"-show-param", "--show-param", "-show-params", "--show-params"} ,
"To print out the paremeters passed to the command line."
};
static const FParameterNames NbParticles = {
{"-nb", "--number-of-particles", "-N"} ,
"The number of particles if they are generated by the executable."
......@@ -191,14 +196,14 @@ inline void PrintUsedOptions(const std::vector<FParameterNames>& options){
}
inline void PrintFlags(){
std::cout << "This executable has been compiled with:\n";
std::cout << "[ScalFMM] This executable has been compiled with:\n";
std::cout << "× Flags = " << SCALFMMCompileFlags << "\n";
std::cout << "× Libs = " << SCALFMMCompileLibs << "\n";
std::cout.flush();
}
inline void PrintDateHost(){
std::cout << "This execution is on:\n";
std::cout << "[ScalFMM] This execution is on:\n";
std::time_t now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
std::cout << "× Date = " << std::ctime(&now) << "\n";
char hostname[1024];
......@@ -207,6 +212,15 @@ inline void PrintDateHost(){
std::cout.flush();
}
inline void PrintGivenParams(int argc, const char* const * const argv){
std::cout << "[ScalFMM] Given Parameters are:\n";
for(int idx = 0 ; idx < argc ; ++idx){
std::cout << " | " << argv[idx];
}
std::cout << "\n";
std::cout.flush();
}
}// End of namespace
/** This should be include at the beginin of all main file
......@@ -219,8 +233,12 @@ inline void PrintDateHost(){
if(FParameters::existParameter(argc, argv, FParameterDefinitions::DateHost.options)) {\
FParameterDefinitions::PrintDateHost();\
} \
if(FParameters::existParameter(argc, argv, FParameterDefinitions::UserParams.options)) {\
FParameterDefinitions::PrintGivenParams(argc, argv);\
} \
if(FParameters::existParameter(argc, argv, FParameterDefinitions::Help.options)) {\
const std::vector<FParameterNames> optionsvec = {FParameterDefinitions::Compile, FParameterDefinitions::DateHost, __VA_ARGS__};\
const std::vector<FParameterNames> optionsvec = {FParameterDefinitions::Compile, FParameterDefinitions::DateHost, \
FParameterDefinitions::UserParams, __VA_ARGS__};\
FParameterDefinitions::PrintUsedOptions(optionsvec);\
return 0;\
} \
......@@ -237,9 +255,13 @@ inline void PrintDateHost(){
if(FParameters::existParameter(argc, argv, FParameterDefinitions::DateHost.options)) {\
FParameterDefinitions::PrintDateHost();\
} \
if(FParameters::existParameter(argc, argv, FParameterDefinitions::UserParams.options)) {\
FParameterDefinitions::PrintGivenParams(argc, argv);\
} \
if(FParameters::existParameter(argc, argv, FParameterDefinitions::Help.options)) {\
std::cout << argv[0] << " : " << description << "\n"; \
const std::vector<FParameterNames> optionsvec = {FParameterDefinitions::Compile, FParameterDefinitions::DateHost, __VA_ARGS__};\
const std::vector<FParameterNames> optionsvec = {FParameterDefinitions::Compile, FParameterDefinitions::DateHost, \
FParameterDefinitions::UserParams, __VA_ARGS__};\
FParameterDefinitions::PrintUsedOptions(optionsvec);\
return 0;\
} \
......
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