-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathreadoptions.cc
63 lines (49 loc) · 1.42 KB
/
readoptions.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* readoptions.cc
Michael Chappell - FMRIB Image Analysis Group
Copyright (C) 2009 University of Oxford */
/* CCOPYRIGHT */
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "utils/log.h"
#include "utils/tracer_plus.h"
#include "armawrap/newmat.h"
#include "readoptions.h"
using namespace std;
using namespace Utilities;
using namespace NEWMAT;
namespace OXASL
{
ReadOptions *ReadOptions::ropt = NULL;
bool ReadOptions::parse_command_line(int argc, char **argv)
{
Tracer_Plus("ReadOptions::parse_command_line");
// do once to establish log directory name
for (int a = options.parse_command_line(argc, argv); a < argc; a++)
;
// setup logger directory
//logger.makeDir(logdir.value());
// cout << "Log directory is: " << logger.getDir() << endl;
// do again so that options are logged
//for(int a = 0; a < argc; a++)
// logger.str() << argv[a] << " ";
//logger.str() << endl << "---------------------------------------------" << endl << endl;
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())
{
options.usage();
throw Exception("Not all of the compulsory arguments have been provided");
}
return true;
}
}