From abe472022e850cfc5fbc66e86e3ad41d313a9b78 Mon Sep 17 00:00:00 2001 From: changsh726 Date: Thu, 10 Sep 2020 17:40:55 +0800 Subject: [PATCH] Scripts: apollo_format.sh bugfix --- cyber/timer/timer.h | 2 +- scripts/apollo_format.sh | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cyber/timer/timer.h b/cyber/timer/timer.h index 260a12911c..99d6cd74b1 100644 --- a/cyber/timer/timer.h +++ b/cyber/timer/timer.h @@ -41,7 +41,7 @@ struct TimerOption { : period(period), callback(callback), oneshot(oneshot) {} /** - * @brief Default onstructor for initializer list + * @brief Default constructor for initializer list * */ TimerOption() : period(), callback(), oneshot() {} diff --git a/scripts/apollo_format.sh b/scripts/apollo_format.sh index 45cac3324d..aba3958545 100755 --- a/scripts/apollo_format.sh +++ b/scripts/apollo_format.sh @@ -32,6 +32,8 @@ FORMAT_PYTHON=0 FORMAT_SHELL=0 FORMAT_ALL=0 +HAS_OPTION=0 + function print_usage() { echo -e "\n${RED}Usage${NO_COLOR}: .${BOLD}$0${NO_COLOR} [OPTION] " @@ -76,22 +78,27 @@ function main() { case "${opt}" in -p | --python) FORMAT_PYTHON=1 + HAS_OPTION=1 shift ;; -c | --cpp) FORMAT_CPP=1 + HAS_OPTION=1 shift ;; -b | --bazel) FORMAT_BAZEL=1 + HAS_OPTION=1 shift ;; -s | --shell) FORMAT_SHELL=1 + HAS_OPTION=1 shift ;; -m | --markdown) FORMAT_MARKDOWN=1 + HAS_OPTION=1 shift ;; -a | --all) @@ -107,7 +114,9 @@ function main() { print_usage exit 1 else - FORMAT_ALL=1 + if [ "$HAS_OPTION" -eq 0 ]; then + FORMAT_ALL=1 + fi break fi ;; -- GitLab