Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
mcraig-ibme committed Sep 11, 2017
2 parents 172ab4e + d013a78 commit 63baeab
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion asl/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def __init__(self, parent):
self.nslices = 1
self.view = 0
self.figure = Figure(figsize=(3.5, 3.5), dpi=100, facecolor='black')
self.axes = self.figure.add_subplot(111, facecolor='black')
self.axes = self.figure.add_subplot(111, axis_bgcolor='black')
self.axes.get_xaxis().set_ticklabels([])
self.axes.get_yaxis().set_ticklabels([])
self.canvas = FigureCanvas(self, -1, self.figure)
Expand Down
5 changes: 4 additions & 1 deletion asl_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ int main(int argc, char *argv[])
{
//parse command line (puts these into the log file)
ReadOptions &opts = ReadOptions::getInstance();
opts.parse_command_line(argc, argv);
if (!opts.parse_command_line(argc, argv))
{
return 0;
}

//deal with input data type options
bool isblocked = false; //indicates if data is in blocks of repeats (of all TIs) rather than TIs
Expand Down
14 changes: 12 additions & 2 deletions readoptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace OXASL
{
ReadOptions *ReadOptions::ropt = NULL;

void ReadOptions::parse_command_line(int argc, char **argv)
bool ReadOptions::parse_command_line(int argc, char **argv)
{
Tracer_Plus("ReadOptions::parse_command_line");

Expand All @@ -41,10 +41,20 @@ void ReadOptions::parse_command_line(int argc, char **argv)
// logger.str() << argv[a] << " ";
//logger.str() << endl << "---------------------------------------------" << endl << endl;

if (help.value() || !options.check_compulsory_arguments())
if (help.value())
{
options.usage();
return false;
}
else if (version.value())
{
cout << GIT_SHA1 << " (" << GIT_DATE << ")" << endl;
return false;
}
else if (!options.check_compulsory_arguments())
{
throw Exception("Not all of the compulsory arguments have been provided");
}
return true;
}
}
9 changes: 8 additions & 1 deletion readoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ReadOptions
static ReadOptions &getInstance();
~ReadOptions() { delete ropt; }
Option<bool> help;
Option<bool> version;

Option<string> datafile;
Option<string> maskfile;
Expand Down Expand Up @@ -67,7 +68,7 @@ class ReadOptions
Option<string> pv_wm_file;
Option<int> kernel;

void parse_command_line(int argc, char **argv);
bool parse_command_line(int argc, char **argv);

private:
ReadOptions();
Expand Down Expand Up @@ -95,6 +96,11 @@ inline ReadOptions::ReadOptions()
false, no_argument)
,

version(string("-v,--version"), false,
string("display version identification"),
false, no_argument)
,

//input files
datafile(string("--data,--datafile"), string("ASL datafile"),
string("data file"),
Expand Down Expand Up @@ -203,6 +209,7 @@ inline ReadOptions::ReadOptions()
try
{
options.add(help);
options.add(version);

options.add(datafile);
options.add(maskfile);
Expand Down

0 comments on commit 63baeab

Please sign in to comment.