代码拉取完成,页面将自动刷新
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。