Skip to content

Commit 752e490

Browse files
committed
implemented %help
1 parent 4e24cb2 commit 752e490

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/tools/clang-repl/ClangRepl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ struct ReplListCompleter {
185185
clang::Interpreter &MainInterp;
186186
ReplListCompleter(clang::IncrementalCompilerBuilder &CB,
187187
clang::Interpreter &Interp)
188-
: CB(CB), MainInterp(Interp){};
188+
: CB(CB), MainInterp(Interp) {};
189189

190190
std::vector<llvm::LineEditor::Completion> operator()(llvm::StringRef Buffer,
191191
size_t Pos) const;
@@ -370,6 +370,8 @@ int main(int argc, const char **argv) {
370370
if (Input == R"(%undo)") {
371371
if (auto Err = Interp->Undo())
372372
llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: ");
373+
} else if (Input == R"(%help)") {
374+
printf("clang-repl commands: { %%undo, %%quit }\n");
373375
} else if (Input.rfind("%lib ", 0) == 0) {
374376
if (auto Err = Interp->LoadDynamicLibrary(Input.data() + 5))
375377
llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: ");

0 commit comments

Comments
 (0)