forked from MRtrix3/mrtrix3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweaks to internal command initialisation
- New function verify_usage() performs AUTHOR and SYNOPSIS non-empty check. - Remove default authorship from R command initialisation. - Remove DEBUG() call within ProgressBar::set_update_method(), since App::log_level will not yet be set.
- Loading branch information
Showing
6 changed files
with
106 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,46 +24,46 @@ | |
|
||
#ifdef MRTRIX_AS_R_LIBRARY | ||
|
||
extern "C" void R_main (int* cmdline_argc, char** cmdline_argv) | ||
{ | ||
::MR::App::build_date = __DATE__; | ||
extern "C" void R_main (int* cmdline_argc, char** cmdline_argv) | ||
{ | ||
::MR::App::build_date = __DATE__; | ||
#ifdef MRTRIX_PROJECT_VERSION | ||
::MR::App::project_version = MRTRIX_PROJECT_VERSION; | ||
#endif | ||
SET_MRTRIX_PROJECT_VERSION | ||
::MR::App::AUTHOR = "J-Donald Tournier ([email protected])"; | ||
::MR::App::DESCRIPTION.clear(); | ||
::MR::App::ARGUMENTS.clear(); | ||
::MR::App::OPTIONS.clear(); | ||
try { | ||
usage(); | ||
::MR::App::init (*cmdline_argc, cmdline_argv); | ||
::MR::App::parse (); | ||
run (); | ||
} | ||
catch (MR::Exception& E) { | ||
E.display(); | ||
return; | ||
} | ||
catch (int retval) { | ||
return; | ||
} | ||
} | ||
SET_MRTRIX_PROJECT_VERSION | ||
::MR::App::DESCRIPTION.clear(); | ||
::MR::App::ARGUMENTS.clear(); | ||
::MR::App::OPTIONS.clear(); | ||
try { | ||
usage(); | ||
::MR::App::verify_usage(); | ||
::MR::App::init (*cmdline_argc, cmdline_argv); | ||
::MR::App::parse (); | ||
run (); | ||
} | ||
catch (MR::Exception& E) { | ||
E.display(); | ||
return; | ||
} | ||
catch (int retval) { | ||
return; | ||
} | ||
} | ||
|
||
extern "C" void R_usage (char** output) | ||
{ | ||
::MR::App::DESCRIPTION.clear(); | ||
::MR::App::ARGUMENTS.clear(); | ||
::MR::App::OPTIONS.clear(); | ||
usage(); | ||
std::string s = MR::App::full_usage(); | ||
*output = new char [s.size()+1]; | ||
strncpy(*output, s.c_str(), s.size()+1); | ||
extern "C" void R_usage (char** output) | ||
{ | ||
::MR::App::DESCRIPTION.clear(); | ||
::MR::App::ARGUMENTS.clear(); | ||
::MR::App::OPTIONS.clear(); | ||
usage(); | ||
std::string s = MR::App::full_usage(); | ||
*output = new char [s.size()+1]; | ||
strncpy(*output, s.c_str(), s.size()+1); | ||
} | ||
|
||
#else | ||
|
||
int main (int cmdline_argc, char** cmdline_argv) | ||
int main (int cmdline_argc, char** cmdline_argv) | ||
{ | ||
#ifdef FLUSH_TO_ZERO | ||
// use gcc switches: -msse -mfpmath=sse -ffast-math | ||
|
@@ -74,28 +74,29 @@ int main (int cmdline_argc, char** cmdline_argv) | |
mxcsr |= (1<<6); // denormals-are-zero | ||
_mm_setcsr (mxcsr); | ||
#endif | ||
::MR::App::build_date = __DATE__; | ||
::MR::App::build_date = __DATE__; | ||
#ifdef MRTRIX_PROJECT_VERSION | ||
::MR::App::project_version = MRTRIX_PROJECT_VERSION; | ||
#endif | ||
try { | ||
::MR::App::init (cmdline_argc, cmdline_argv); | ||
usage (); | ||
::MR::App::init (cmdline_argc, cmdline_argv); | ||
usage (); | ||
::MR::App::verify_usage(); | ||
::MR::App::parse_special_options(); | ||
#ifdef __gui_app_h__ | ||
::MR::GUI::App app (cmdline_argc, cmdline_argv); | ||
#endif | ||
::MR::App::parse (); | ||
::MR::App::parse (); | ||
run (); | ||
} | ||
} | ||
catch (::MR::Exception& E) { | ||
E.display(); | ||
E.display(); | ||
return 1; | ||
} | ||
catch (int retval) { | ||
return retval; | ||
} | ||
return 0; | ||
} | ||
catch (int retval) { | ||
return retval; | ||
} | ||
return 0; | ||
} | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.