aboutsummaryrefslogtreecommitdiffstats
path: root/cgrep.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cgrep.cpp')
-rw-r--r--cgrep.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/cgrep.cpp b/cgrep.cpp
index 41ef737..3cdff06 100644
--- a/cgrep.cpp
+++ b/cgrep.cpp
@@ -1106,11 +1106,16 @@ private:
/*Main*/
int main(int argc, const char **argv) {
#if __clang_major__ >= 13
- auto op = CommonOptionsParser::create(argc, argv, CGrepCat);
+ auto op =
+ CommonOptionsParser::create(argc, argv, CGrepCat);
+ if (auto error = op.takeError()) {
+ errs() << toString(std::move(error)) << "\n";
+ return 1;
+ }
+ ClangTool Tool(op->getCompilations(), op->getSourcePathList());
#else
CommonOptionsParser op(argc, argv, CGrepCat);
#endif
- ClangTool Tool(op.getCompilations(), op.getSourcePathList());
int ret = 0;
if ("" != CO_TRACE) {