mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 06:22:07 +02:00
clang-format: add page (#4736)
This commit is contained in:
parent
5452227937
commit
b8a1ccc200
1 changed files with 24 additions and 0 deletions
24
pages/common/clang-format.md
Normal file
24
pages/common/clang-format.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
# clang-format
|
||||
|
||||
> Tool to auto-format C/C++/Java/JavaScript/Objective-C/Protobuf/C# code.
|
||||
> More information: <https://clang.llvm.org/docs/ClangFormat.html>.
|
||||
|
||||
- Format a file and print the result to `stdout`:
|
||||
|
||||
`clang-format {{path/to/file}}`
|
||||
|
||||
- Format a file in-place:
|
||||
|
||||
`clang-format -i {{path/to/file}}`
|
||||
|
||||
- Format a file using a predefined coding style:
|
||||
|
||||
`clang-format --style={{LLVM|Google|Chromium|Mozilla|WebKit}} {{path/to/file}}`
|
||||
|
||||
- Format a file using the `.clang-format` file in one of the parent directories of the source file:
|
||||
|
||||
`clang-format --style=file {{path/to/file}}`
|
||||
|
||||
- Generate a custom `.clang-format` file:
|
||||
|
||||
`clang-format --style={{LLVM|Google|Chromium|Mozilla|WebKit}} --dump-config > {{.clang-format}}`
|
Loading…
Add table
Reference in a new issue