split argv parsing between root (un)related parts.
This commit is contained in:
@@ -444,37 +444,15 @@ void musrfit_dump_root(char *fileName, PRunListCollection *runList)
|
|||||||
*/
|
*/
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
bool show_syntax = false;
|
bool show_syntax = false;
|
||||||
int status;
|
|
||||||
bool keep_mn2_output = false;
|
|
||||||
bool chisq_only = false;
|
|
||||||
bool yaml_out = false;
|
|
||||||
bool title_from_data_file = false;
|
|
||||||
bool timeout_enabled = true;
|
|
||||||
bool reset_startup_file = false;
|
|
||||||
PStartupOptions startup_options;
|
|
||||||
startup_options.writeExpectedChisq = false;
|
|
||||||
startup_options.estimateN0 = false;
|
|
||||||
int number_of_cores=1;
|
|
||||||
|
|
||||||
#ifdef HAVE_GOMP
|
// check syntax (root unrelated)
|
||||||
number_of_cores = omp_get_num_procs();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
TString dump("");
|
|
||||||
char filename[1024];
|
|
||||||
|
|
||||||
// check syntax
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
musrfit_syntax();
|
musrfit_syntax();
|
||||||
return PMUSR_WRONG_STARTUP_SYNTAX;
|
return PMUSR_WRONG_STARTUP_SYNTAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add default shared library path /usr/local/lib if not already persent
|
|
||||||
const char *dsp = gSystem->GetDynamicPath();
|
|
||||||
if (strstr(dsp, "/usr/local/lib") == nullptr)
|
|
||||||
gSystem->AddDynamicPath("/usr/local/lib");
|
|
||||||
|
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
if (!strcmp(argv[1], "--version")) {
|
if (!strcmp(argv[1], "--version")) {
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
@@ -498,12 +476,8 @@ int main(int argc, char *argv[])
|
|||||||
std::cout << std::endl << "musrfit: NeXus support NOT enabled." << std::endl << std::endl;
|
std::cout << std::endl << "musrfit: NeXus support NOT enabled." << std::endl << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return PMUSR_SUCCESS;
|
return PMUSR_SUCCESS;
|
||||||
} else if (!strcmp(argv[1], "--show-dynamic-path")) {
|
|
||||||
std::cout << std::endl << "musrfit: internal dynamic search paths for shared libraries/root dictionaries:";
|
|
||||||
std::cout << std::endl << " '" << gSystem->GetDynamicPath() << "'" << std::endl << std::endl;
|
|
||||||
return PMUSR_SUCCESS;
|
|
||||||
} else if (!strcmp(argv[1], "--help")) {
|
} else if (!strcmp(argv[1], "--help")) {
|
||||||
show_syntax = true;
|
show_syntax = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,6 +486,39 @@ int main(int argc, char *argv[])
|
|||||||
return PMUSR_WRONG_STARTUP_SYNTAX;
|
return PMUSR_WRONG_STARTUP_SYNTAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int status;
|
||||||
|
bool keep_mn2_output = false;
|
||||||
|
bool chisq_only = false;
|
||||||
|
bool yaml_out = false;
|
||||||
|
bool title_from_data_file = false;
|
||||||
|
bool timeout_enabled = true;
|
||||||
|
bool reset_startup_file = false;
|
||||||
|
PStartupOptions startup_options;
|
||||||
|
startup_options.writeExpectedChisq = false;
|
||||||
|
startup_options.estimateN0 = false;
|
||||||
|
int number_of_cores=1;
|
||||||
|
|
||||||
|
#ifdef HAVE_GOMP
|
||||||
|
number_of_cores = omp_get_num_procs();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
TString dump("");
|
||||||
|
char filename[1024];
|
||||||
|
|
||||||
|
// add default shared library path /usr/local/lib if not already persent
|
||||||
|
const char *dsp = gSystem->GetDynamicPath();
|
||||||
|
if (strstr(dsp, "/usr/local/lib") == nullptr)
|
||||||
|
gSystem->AddDynamicPath("/usr/local/lib");
|
||||||
|
|
||||||
|
// check syntax (root related)
|
||||||
|
if (argc == 2) {
|
||||||
|
if (!strcmp(argv[1], "--show-dynamic-path")) {
|
||||||
|
std::cout << std::endl << "musrfit: internal dynamic search paths for shared libraries/root dictionaries:";
|
||||||
|
std::cout << std::endl << " '" << gSystem->GetDynamicPath() << "'" << std::endl << std::endl;
|
||||||
|
return PMUSR_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
strcpy(filename, "");
|
strcpy(filename, "");
|
||||||
for (int i=1; i<argc; i++) {
|
for (int i=1; i<argc; i++) {
|
||||||
if (strstr(argv[i], ".msr")) {
|
if (strstr(argv[i], ".msr")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user