MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / getControlNameFromCommandLine

Function getControlNameFromCommandLine

src/main.cpp:126–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126static const char* getControlNameFromCommandLine(int argc, char *argv[])
127{
128 const char* sample_file;
129 bool sample_file_set=0;
130
131 if (argc >= 3 && (strcmp(argv[1], "-c") == 0 || strcmp(argv[1], "-control") == 0 || strcmp(argv[1], "--c") == 0 || strcmp(argv[1], "--control") == 0)) {
132 sample_file = argv[2];
133 sample_file_set=1;
134 } else {
135 if (argc >= 5 && (strcmp(argv[3], "-c") == 0 || strcmp(argv[3], "-control") == 0 || strcmp(argv[3], "--c") == 0 || strcmp(argv[3], "--control") == 0)) {
136 sample_file = argv[4];
137 sample_file_set=1;
138 } else {
139 if (argc >= 7 && (strcmp(argv[5], "-c") == 0 || strcmp(argv[5], "-control") == 0 || strcmp(argv[5], "--c") == 0 || strcmp(argv[5], "--control") == 0)) {
140 sample_file = argv[6];
141 sample_file_set=1;
142 }
143 }
144 }
145 if(!sample_file_set) {
146 return ("");
147 }
148 ifstream ifile(sample_file);
149 if (!ifile) {
150 std::cerr << "\n\tCould not find your control file.. Please, check the existance of "<< sample_file <<"\n\n";
151 usage();
152 exit(-1);
153 }
154 return sample_file;
155}
156
157static void thread_init(unsigned int max_threads, unsigned int thread_verbose)
158{

Callers 1

mainFunction · 0.85

Calls 1

usageFunction · 0.85

Tested by

no test coverage detected