-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cc
46 lines (29 loc) · 857 Bytes
/
main.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
#include <cli.h>
#include <llvm/Support/FileSystem.h>
#include <llvm/Support/MemoryBuffer.h>
#include <llvm/Support/Path.h>
#include <textract.h>
inline void printHelp() {
sout << "Usage:\n";
sout << " ./main <inputDirPath> [<outputDirPath>]\n";
sout << " ./main <inputFilePath> [<outputFilePath>]\n";
}
auto main(int argc, char **argv) -> int {
printSystemInfo();
if (argc < 2) {
printHelp();
return 1;
}
llvm::StringRef inputPath(argv[1]);
llvm::StringRef outputPath;
if (argc >= 3) {
outputPath = argv[2];
}
process(inputPath, outputPath);
sout << "Processing completed successfully.\n";
return 0;
}
/*
./textract_static /Users/kuro/Documents/Code/Cpp/image/imgapp/images
./textract_static /Users/kuro/Documents/Code/Cpp/image/imgapp/images/screenshot.png
*/