9 Star 14 Fork 0

Tecorigin / Teco-AL

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
format2google 839 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
#set -e
#set -x
if [[ "$(which clang-format)" == "" ]]; then
echo "Please install clang-format on your OS!"
fi
usage () {
echo "USAGE: format2google [options] <file>"
echo " format2google [options] <dir>"
echo
echo "OPTIONS:"
echo " -h, --help Print usage"
echo
}
if [[ $# -eq 1 ]]; then
case "${1}" in
-h | --help)
usage
exit 0
;;
* )
input=${1}
;;
esac
else
usage
exit 1
fi
file_list=$(find ${input} -name "*.c" -or -name "*.cpp" -or -name "*.scpp" -or -name "*.h" -or -name "*.hpp")
for file in ${file_list}; do
echo "clang-format formating ${file} ..."
clang-format -style=file -i ${file}
# clang-format -style="{BasedOnStyle: google, PointerAlignment: Right, SortIncludes: Never, ColumnLimit: 100}" -i ${file}
done
1
https://gitee.com/tecorigin/teco-al.git
git@gitee.com:tecorigin/teco-al.git
tecorigin
teco-al
Teco-AL
develop

搜索帮助