astyle 是一个代码格式化工具,为 C,C++,JAVA 等语言提供代码格式化功能。
官方描述为:Artistic Style is a source code indenter, formatter, and beautifier for the C, C++, C++/CLI, Objective‑C, C# and Java programming languages.
相关页面:官方地址,文档地址,下载页面(当前最新版本位 3.1) 。
一、编译安装
安装可参考官方安装文档,提供了多种方式编译安装,这里使用 cmake 。
|
1 2 3 4 5 6 7 8 9 10 |
# 解压 tar -zxvf astyle_3.1_linux.tar.gz cd astyle # 创建编译文件夹 mkdir as-gcc-exe cd as-gcc-exe cmake .. # 编译和安装 make make install |
默认情况下,可执行文件被安装在/usr/bin,文档放在/usr/share/doc/astyle,安装完成后直接就可使用 astyle 命令。
官方并没有提供 make uninstall 卸载的功能,如需卸载需要在编译目录下执行 xargs rm < install_manifest.txt 。