code format using astyle

script context :

#! /bin/bash

for f in $(find . -name '*.c' -or -name '*.cpp' -or -name '*.h' -type f)
do
astyle --style=kr --indent=tab -p -P -k1 $f
done

# after formate the code,we need to rm '*.orig' files
for f in $(find . -name '*.orig' -type f)
do
rm $f
done

 

effect picture :

 

posted @ 2018-12-10 17:39  嵌入式实操  阅读(131)  评论(0编辑  收藏  举报