|
| 1 | +#include <iostream> |
| 2 | +#include <fstream> |
| 3 | +#include <sstream> |
| 4 | +#include <string> |
| 5 | +#include <cstdlib> |
| 6 | +#include <stdio.h> |
| 7 | +#include <string.h> |
| 8 | +#include <zlib.h> |
| 9 | +#include "src/convert/covert.h" |
| 10 | +#include "src/modify/modify.h" |
| 11 | +#include "src/statistics/statistics.h" |
| 12 | +#include "src/visualize/visualize.h" |
| 13 | + |
| 14 | +using namespace std; |
| 15 | + |
| 16 | +int convert_main(int argc, char *argv[]) ; |
| 17 | +int modify_main(int argc, char *argv[]); |
| 18 | +int statistics_main(int argc, char *argv[]); |
| 19 | +int visualize_main(int argc, char *argv[]); |
| 20 | + |
| 21 | +static int AllTools_usage () |
| 22 | +{ |
| 23 | + cerr << "Program: BamDeal\nVersion: 0.27\t[email protected]\t"<<__DATE__<<endl; |
| 24 | + |
| 25 | + cerr<<"" |
| 26 | + "\n" |
| 27 | + "\tUsage:\n\n" |
| 28 | + "\t\tconvert convert tools\n" |
| 29 | + "\t\tmodify modify tools\n" |
| 30 | + "\t\tstatistics statistics analysis tools\n" |
| 31 | + "\t\tvisualize visualize tools for bam\n" |
| 32 | + "\n" |
| 33 | + "\t\tHelp Show help in detail\n" |
| 34 | + "\n"; |
| 35 | + return 1; |
| 36 | +} |
| 37 | + |
| 38 | +static int AllTools_usage2 () |
| 39 | +{ |
| 40 | + cerr << "Program: BamDeal\nVersion: 0.27\t[email protected]\t"<<__DATE__<<endl; |
| 41 | + |
| 42 | + cerr<<"" |
| 43 | + "\n" |
| 44 | + "\tUsage:\n\n" |
| 45 | + "\t\tconvert convert tools\n" |
| 46 | + "\t\tmodify modify tools\n" |
| 47 | + "\t\tstatistics statistics analysis tools\n" |
| 48 | + "\t\tvisualize visualize tools for bam\n" |
| 49 | + "\n" |
| 50 | + "\t\tHelp Show help in detail\n" |
| 51 | + "\n" |
| 52 | + |
| 53 | + "\t\tjoin the QQ Group : 12529366\n" |
| 54 | + "\n"; |
| 55 | + return 1; |
| 56 | +} |
| 57 | + |
| 58 | + |
| 59 | +int main(int argc, char *argv[]) |
| 60 | +{ |
| 61 | + if (argc < 2) { return AllTools_usage(); } |
| 62 | + else if (strcmp(argv[1], "convert") == 0) { return convert_main(argc-1, argv+1) ; } |
| 63 | + else if (strcmp(argv[1], "statistics") == 0) { return statistics_main(argc-1, argv+1) ; } |
| 64 | + else if (strcmp(argv[1], "visualize") == 0) { return visualize_main(argc-1, argv+1) ; } |
| 65 | + else if (strcmp(argv[1], "modify") == 0) { return modify_main(argc-1, argv+1) ; } |
| 66 | + else if (strcmp(argv[1], "Help") == 0 || strcmp(argv[1], "help") == 0 || strcmp(argv[1], "?")== 0 || ( argv[1][0] == '-' &&( argv[1][1] =='h' || argv[1][1] =='H' || argv[1][1] =='?' ) ) || strcmp(argv[1], "less") == 0 ) |
| 67 | + { |
| 68 | + return AllTools_usage2(); |
| 69 | + } |
| 70 | + else |
| 71 | + { |
| 72 | + cerr<<"BamDeal [main] unrecognized command "<<argv[1]<<endl; |
| 73 | + return 1; |
| 74 | + } |
| 75 | + |
| 76 | + return 0; |
| 77 | +} |
| 78 | + |
| 79 | + |
0 commit comments