Skip to content
Snippets Groups Projects
Commit f5fc1e8d authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

MNT: Use a namespace, as there are other things in the world called "data",

"glm", etc etc.
parent ed7d1421
No related branches found
No related tags found
1 merge request!9mnt/conda
......@@ -21,6 +21,8 @@ using namespace std;
// The two strings below specify the title and example usage that is
// printed out as the help or usage message
namespace FSL_GLM {
string title=string("fsl_glm")+
string("\nAuthor: Christian F. Beckmann \nCopyright(C) 2006-2013 University of Oxford \n")+
string(" \n Simple GLM allowing temporal or spatial regression on either text data or images\n");
......@@ -309,57 +311,58 @@ using namespace std;
write_res();
return 0;
}
}
////////////////////////////////////////////////////////////////////////////
using namespace FSL_GLM;
int main(int argc,char *argv[]){
Tracer tr("main");
OptionParser options(title, examples);
try{
// must include all wanted options here (the order determines how
// the help message is printed)
options.add(fnin);
options.add(fnout);
options.add(fndesign);
options.add(fncontrasts);
options.add(fnmask);
options.add(fnftest);
options.add(dofset);
options.add(normdes);
options.add(normdat);
options.add(perfvn);
options.add(perf_demean);
options.add(help);
options.add(debug);
options.add(outcope);
options.add(outz);
options.add(outt);
options.add(outp);
options.add(outf);
options.add(outpf);
options.add(outres);
options.add(outvarcb);
options.add(outsigsq);
options.add(outdata);
options.add(outvnscales);
options.add(textConfounds);
options.add(voxelwiseConfounds);
options.parse_command_line(argc, argv);
int main(int argc,char *argv[]){
Tracer tr("main");
OptionParser options(title, examples);
try{
// must include all wanted options here (the order determines how
// the help message is printed)
options.add(fnin);
options.add(fnout);
options.add(fndesign);
options.add(fncontrasts);
options.add(fnmask);
options.add(fnftest);
options.add(dofset);
options.add(normdes);
options.add(normdat);
options.add(perfvn);
options.add(perf_demean);
options.add(help);
options.add(debug);
options.add(outcope);
options.add(outz);
options.add(outt);
options.add(outp);
options.add(outf);
options.add(outpf);
options.add(outres);
options.add(outvarcb);
options.add(outsigsq);
options.add(outdata);
options.add(outvnscales);
options.add(textConfounds);
options.add(voxelwiseConfounds);
options.parse_command_line(argc, argv);
// line below stops the program if the help was requested or
// a compulsory option was not set
if ( (help.value()) || (!options.check_compulsory_arguments(true)) ){
options.usage();
exit(EXIT_FAILURE);
}else{
// Call the local functions
return do_work(argc,argv);
}
}catch(X_OptionError& e) {
// line below stops the program if the help was requested or
// a compulsory option was not set
if ( (help.value()) || (!options.check_compulsory_arguments(true)) ){
options.usage();
cerr << endl << e.what() << endl;
exit(EXIT_FAILURE);
}catch(std::exception &e) {
cerr << e.what() << endl;
}else{
// Call the local functions
return do_work(argc,argv);
}
}catch(X_OptionError& e) {
options.usage();
cerr << endl << e.what() << endl;
exit(EXIT_FAILURE);
}catch(std::exception &e) {
cerr << e.what() << endl;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment