yang.li | e335155 | 2022-03-25 09:46:02 +0800 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | # |
| 3 | # Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved. |
| 4 | # |
| 5 | # SPDX-License-Identifier: MIT |
| 6 | # |
| 7 | |
| 8 | PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1" |
| 9 | |
| 10 | function read_dir(){ |
| 11 | for file in `ls $1` |
| 12 | do |
| 13 | if [ -d $1"/"$file ] |
| 14 | then |
| 15 | read_dir $1"/"$file |
| 16 | else |
| 17 | if [ "${file##*.}"x = "c"x ]||[ "${file##*.}"x = "cpp"x ]||[ "${file##*.}"x = "h"x ];then |
| 18 | echo $1"/"$file |
| 19 | indent $PARAM $1"/"$file -o $1"/"$file |
| 20 | fi |
| 21 | fi |
| 22 | done |
| 23 | } |
| 24 | |
| 25 | #excute |
| 26 | read_dir ${1%*/} |
| 27 | |