[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / tools / diagtool / diagtool_main.cpp
blob7cbe93de9c11028c44a02521508c4d2e3b5b47a5
1 //===- diagtool_main.h - Entry point for invoking all diagnostic tools ----===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the main function for diagtool.
11 //===----------------------------------------------------------------------===//
13 #include "DiagTool.h"
15 using namespace diagtool;
17 int main(int argc, char *argv[]) {
18 if (argc > 1)
19 if (DiagTool *tool = diagTools->getTool(argv[1]))
20 return tool->run(argc - 2, &argv[2], llvm::outs());
22 llvm::errs() << "usage: diagtool <command> [<args>]\n\n";
23 diagTools->printCommands(llvm::errs());
24 return 1;