Skip to content

Commit 99e2421

Browse files
committed
blurb about %help on startup. better %help format
1 parent 752e490 commit 99e2421

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clang/tools/clang-repl/ClangRepl.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,11 @@ int main(int argc, const char **argv) {
347347
}
348348
}
349349

350+
const char *percent_commands = "%help\tlist clang-repl %commands\n"
351+
"%undo\tundo the previous input\n"
352+
"%quit\texit clang-repl\n";
350353
if (OptInputs.empty()) {
354+
printf("%%help for list of clang-repl commands\n");
351355
llvm::LineEditor LE("clang-repl");
352356
std::string Input;
353357
LE.setListCompleter(ReplListCompleter(CB, *Interp));
@@ -371,7 +375,7 @@ int main(int argc, const char **argv) {
371375
if (auto Err = Interp->Undo())
372376
llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: ");
373377
} else if (Input == R"(%help)") {
374-
printf("clang-repl commands: { %%undo, %%quit }\n");
378+
printf("%s\n", percent_commands);
375379
} else if (Input.rfind("%lib ", 0) == 0) {
376380
if (auto Err = Interp->LoadDynamicLibrary(Input.data() + 5))
377381
llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: ");

0 commit comments

Comments
 (0)