<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/143666>143666</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-repl lacks documentation on the supported % commands and a way to discover them from within clang-repl
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          DavidSpickett
      </td>
    </tr>
</table>

<pre>
    clang-repl has some special cased commands like `%quit`, `%undo`, but they are not as easy to discover as they could be.

`%quit` is documented here https://clang.llvm.org/docs/ClangRepl.html#closure-or-termination but there's no way to know it exists if you are just inside `clang-repl`. Though if you've read one example file, you probably know it exists.

`%undo` is not mentioned on that page at all. It's only in clang-repl's source code and test cases.

It would be great if:
* The documentation mentioned `%undo` and what it does (which is a great feature, so it deserves to be highlighted anyway!)
* There was some other command that would list all valid `%` commands while in clang-repl. For instance `%help`. (maybe more effort than you want to put in for 2 commands, but it would help the first time user experience)
* clang-repl printed some opening line like "type %help to list commands".
* `clang-repl --help` would include some blurb about usage, currently it jumps right into options that seem like they come from clang:
```
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build>.\bin\clang-repl --help
USAGE: clang-repl [options] [code to run]

OPTIONS:
```
* `%some-invalid-command` would print an error stating what I could have used. This one might not be possible as perhaps there is some scenario where `%something` might be part of code?

Perhaps I am treating clang-repl as a user facing thing rather than a library to be wrapped up in something else. In which case this is all understandable.

Also some of this might be a good first issue? If a maintainer thinks so please add that label.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkVc1y27wOfRp6g7FHpiMlXnjhL6nveHPbuW0fABIhiQ1F6vLHqt_-G1CynbQznpHEMMDBAc4BhqA7S3QQ5T-ifFthir3zhze8aPV91M07xbiqnboeGoO2W3saDfQYILiBIIzUaDTQYCAFjRsGtCqA0e8EoiqELP-fdMxvr8tBssotB3WKEHu6A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