如何在cpp项目文件夹中调用clang格式? [英] How to call clang-format over a cpp project folder?
本文介绍了如何在cpp项目文件夹中调用clang格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以为整个cpp项目文件夹调用类似 clang-format --style = Webkit
之类的方法,而不是为每个文件分别运行它? p>
我正在使用 clang-format.py
和 vim
来做到这一点,但我认为有一种方法可以应用一次。
解决方案
怎么办:
clang-format -i -style = WebKit * .cpp * .h
在项目文件夹中。 -i选项使它就位(默认情况下,格式化的输出将写入stdout)。
Is there a way to call something like clang-format --style=Webkit
for an entire cpp project folder, rather than running it separately for each file?
I am using clang-format.py
and vim
to do this, but I assume there is a way to apply this once.
解决方案
What about:
clang-format -i -style=WebKit *.cpp *.h
in the project folder. The -i option makes it inplace (by default formatted output is written to stdout).
这篇关于如何在cpp项目文件夹中调用clang格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文