[clang] [clang-repl] adding documentation and information for %commands (PR #150348)
David Spickett via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 4 02:18:22 PDT 2025
================
@@ -364,15 +366,34 @@ int main(int argc, const char **argv) {
}
Input += L;
+ // If we add more % commands, there should be better architecture than
+ // this.
if (Input == R"(%quit)") {
break;
}
if (Input == R"(%undo)") {
if (auto Err = Interp->Undo())
llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: ");
+ } else if (Input == R"(%help)") {
+ OS << "%help\t\tlist clang-repl %commands\n"
----------------
DavidSpickett wrote:
Since OS is only used once you can simplify to:
```
llvm::outs() << "...."
```
https://github.com/llvm/llvm-project/pull/150348
More information about the cfe-commits
mailing list