-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
61 lines (54 loc) · 1.55 KB
/
main.cpp
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
#include <iostream>
#include <string>
#include "main.h"
#include "header\install.h"
#include "header\clist.h"
#include "header\stats.h"
#include "header\extractor.h"
using namespace std;
void version(int argc,char **argv){
cout << "omnTools [Version "<<omnTools_VERSION_MAJOR<<"."
<<omnTools_VERSION_MINOR<<"."
<<omnTools_VERSION_PATCH<<"."
<<omnTools_VERSION_TWEAK<<"]"
<< endl;
cout << "Copyright by AGSN" << endl;
}
void (*tool[])(int,char**) = {
version,
install,
clist,
stats,
extractor
};
string tooln[] = {
"v",
"i",
"l",
"s",
"e"
};
string toolh[] = {
"\033[1;36;40mcommand lists\033[0m",
"\033[1;32;40momn v\033[0m\tQuery the version",
"\033[1;32;40momn i [name]\033[0m\tInstallation [name]",
"\033[1;32;40momn l [lang/shell/os] <key>\033[0m\tTo print the [lang/shell/os] command prompt list, you can use the <key> specified command keyword",
"\033[1;32;40momn s <dir>\033[0m\tStatistical language file(-l) or all file(-a), using <dir> the specified directory",
"\033[1;32;40momn e [srctype] [dir]\033[0m\tTo extract resources, you need to specify the source file type, which currently supports 'apk'."
};
int main(int argc,char **argv){
bool nocode = true;
if(argc==1){
for(int i=0;i<sizeof(toolh)/sizeof(string);i++)
cout<<toolh[i]<<endl;
return 0;
}
for(int i=0;i<sizeof(tooln)/sizeof(string);i++)
if(argv[1]==tooln[i]){
nocode = false;
tool[i](argc,argv);
return 0;
}
if(nocode)cout<<"Not found \""<<argv[1]<<"\".";
return 0;
}