[clang] [clang-repl] adding documentation and information for %commands (PR #150348)

David Spickett via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 29 05:32:45 PDT 2025


================
@@ -370,6 +379,10 @@ int main(int argc, const char **argv) {
       if (Input == R"(%undo)") {
         if (auto Err = Interp->Undo())
           llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: ");
+      } else if (Input == R"(%help)") {
+        OS << help_output << '\n';
+      } else if (Input[0] == '%') { // make sure this is evaluated last
+        OS << "Invalid % command: \"" << Input << "\". " << help_prompt;
----------------
DavidSpickett wrote:

Also I think what you've got is fine but could be improved if it were:
```
Invalid % command "<whatever>", use "%help" to list commands.
```

https://github.com/llvm/llvm-project/pull/150348


More information about the cfe-commits mailing list