提交 abe47202 编写于 作者: C changsh726 提交者: Liu Jiaming

Scripts: apollo_format.sh bugfix

上级 600a1102
...@@ -41,7 +41,7 @@ struct TimerOption { ...@@ -41,7 +41,7 @@ struct TimerOption {
: period(period), callback(callback), oneshot(oneshot) {} : period(period), callback(callback), oneshot(oneshot) {}
/** /**
* @brief Default onstructor for initializer list * @brief Default constructor for initializer list
* *
*/ */
TimerOption() : period(), callback(), oneshot() {} TimerOption() : period(), callback(), oneshot() {}
......
...@@ -32,6 +32,8 @@ FORMAT_PYTHON=0 ...@@ -32,6 +32,8 @@ FORMAT_PYTHON=0
FORMAT_SHELL=0 FORMAT_SHELL=0
FORMAT_ALL=0 FORMAT_ALL=0
HAS_OPTION=0
function print_usage() { function print_usage() {
echo -e "\n${RED}Usage${NO_COLOR}: echo -e "\n${RED}Usage${NO_COLOR}:
.${BOLD}$0${NO_COLOR} [OPTION] <path/to/src/dir/or/files>" .${BOLD}$0${NO_COLOR} [OPTION] <path/to/src/dir/or/files>"
...@@ -76,22 +78,27 @@ function main() { ...@@ -76,22 +78,27 @@ function main() {
case "${opt}" in case "${opt}" in
-p | --python) -p | --python)
FORMAT_PYTHON=1 FORMAT_PYTHON=1
HAS_OPTION=1
shift shift
;; ;;
-c | --cpp) -c | --cpp)
FORMAT_CPP=1 FORMAT_CPP=1
HAS_OPTION=1
shift shift
;; ;;
-b | --bazel) -b | --bazel)
FORMAT_BAZEL=1 FORMAT_BAZEL=1
HAS_OPTION=1
shift shift
;; ;;
-s | --shell) -s | --shell)
FORMAT_SHELL=1 FORMAT_SHELL=1
HAS_OPTION=1
shift shift
;; ;;
-m | --markdown) -m | --markdown)
FORMAT_MARKDOWN=1 FORMAT_MARKDOWN=1
HAS_OPTION=1
shift shift
;; ;;
-a | --all) -a | --all)
...@@ -107,7 +114,9 @@ function main() { ...@@ -107,7 +114,9 @@ function main() {
print_usage print_usage
exit 1 exit 1
else else
FORMAT_ALL=1 if [ "$HAS_OPTION" -eq 0 ]; then
FORMAT_ALL=1
fi
break break
fi fi
;; ;;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册