kbobyrev created this revision. kbobyrev added reviewers: ioeric, ilya-biryukov. kbobyrev added a project: clang-tools-extra. Herald added subscribers: arphaman, jkorous, MaskRay.
`global-symbol-builder` help message mentions `-executor=<string>` option, but doesn't give any example of what the value could be Assuming the most popular use case to be building the whole project index, help message should probably give an example of such usage. https://reviews.llvm.org/D49785 Files: clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp Index: clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp =================================================================== --- clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp +++ clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp @@ -150,10 +150,16 @@ int main(int argc, const char **argv) { llvm::sys::PrintStackTraceOnErrorSignal(argv[0]); - const char* Overview = - "This is an **experimental** tool to generate YAML-format " - "project-wide symbols for clangd (global code completion). It would be " - "changed and deprecated eventually. Don't use it in production code!"; + const auto Overview = R"( + This is an **experimental** tool to generate YAML-format project-wide symbols + for clangd (global code completion). It would be changed and deprecated + eventually. Don't use it in production code! + + Example usage for building index for the whole project: + + $ global-symbol-builder --executor=all-TUs compile_commands.json > index.yaml + )"; + auto Executor = clang::tooling::createExecutorFromCommandLineArgs( argc, argv, cl::GeneralCategory, Overview);
Index: clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp =================================================================== --- clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp +++ clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp @@ -150,10 +150,16 @@ int main(int argc, const char **argv) { llvm::sys::PrintStackTraceOnErrorSignal(argv[0]); - const char* Overview = - "This is an **experimental** tool to generate YAML-format " - "project-wide symbols for clangd (global code completion). It would be " - "changed and deprecated eventually. Don't use it in production code!"; + const auto Overview = R"( + This is an **experimental** tool to generate YAML-format project-wide symbols + for clangd (global code completion). It would be changed and deprecated + eventually. Don't use it in production code! + + Example usage for building index for the whole project: + + $ global-symbol-builder --executor=all-TUs compile_commands.json > index.yaml + )"; + auto Executor = clang::tooling::createExecutorFromCommandLineArgs( argc, argv, cl::GeneralCategory, Overview);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits