-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArgParseOutput.h
54 lines (40 loc) · 1.16 KB
/
ArgParseOutput.h
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
/**
* Contact: [email protected]
*/
#include <iostream>
#include <string>
#include <tclap/CmdLine.h>
using std::cerr;
using std::cout;
using std::endl;
class ArgParseOutput: public TCLAP::StdOutput {
private:
std::string usageStr;
std::string versionStr;
public:
ArgParseOutput(std::string usage, std::string version) {
usageStr = usage;
versionStr = version;
}
virtual ~ArgParseOutput() {
}
virtual void failure(TCLAP::CmdLineInterface& c, TCLAP::ArgException& e) {
cerr << "Error:" << endl;
cerr << " " << e.error() << endl;
cerr << endl;
cerr << "Short usage:" << endl;
cerr << " translocator [options] -m <sorted.bam> -a <ref.fa> -v <output.vcf> " << endl;
cerr << "Version: " << Parameter::Instance()->version << std::endl;
cerr << "Contact: [email protected]" << std::endl;
cerr << endl;
cerr << "For complete USAGE and HELP type:" << endl;
cerr << " translocator --help" << endl;
cerr << endl;
exit(1);
}
virtual void usage(TCLAP::CmdLineInterface& c) {
cerr << usageStr << std::endl;
}
virtual void version(TCLAP::CmdLineInterface& c) {
}
};