代码格式化工具astyle的安装和使用
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
。
# 解压
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
。