add quiet options
This commit is contained in:
@@ -14,14 +14,18 @@ Usage: $me [OPTION]...
|
||||
Standard GCK cleanup
|
||||
|
||||
Options:
|
||||
-q, --quiet silence output
|
||||
|
||||
--help print this help and exit
|
||||
--version output version information"
|
||||
--help print this help and exit
|
||||
--version output version information"
|
||||
|
||||
QUIET=
|
||||
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
--help) echo "$usage"; exit 0;;
|
||||
--version) echo "$version"; exit 0;;
|
||||
--quiet|-q) QUIET="--quiet";;
|
||||
-*)
|
||||
echo "$0: Unknown option '$1'." >&2
|
||||
echo "$0: Try '--help' for more information.'$1'." >&2
|
||||
@@ -41,9 +45,11 @@ run() {
|
||||
|
||||
[ -d "./git" ] && fatal "must be run from parent directory"
|
||||
|
||||
run sh ./tools/format
|
||||
run sh ./tools/format $QUIET
|
||||
run rm -rf .cache
|
||||
run rm -f compile_commands.json
|
||||
run make distclean
|
||||
|
||||
echo "done."
|
||||
if [ -z "$QUIET" ]; then
|
||||
echo "done."
|
||||
fi
|
||||
|
||||
13
tools/format
13
tools/format
@@ -14,14 +14,18 @@ Usage: $me [OPTION]...
|
||||
Format C source code
|
||||
|
||||
Options:
|
||||
-q, -quiet silence output
|
||||
|
||||
--help print this help and exit
|
||||
--version output version information"
|
||||
--help print this help and exit
|
||||
--version output version information"
|
||||
|
||||
QUIET=
|
||||
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
--help) echo "$usage"; exit 0;;
|
||||
--version) echo "$version"; exit 0;;
|
||||
--quiet|-q) QUIET=true;;
|
||||
-*)
|
||||
echo "$0: Unknown option '$1'." >&2
|
||||
echo "$0: Try '--help' for more information.'$1'." >&2
|
||||
@@ -30,5 +34,10 @@ while test $# -gt 0; do
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$QUIET" ]; then
|
||||
find . -type f -name '*.c' ! -path './lib/*' ! -path './gcklib/*' -exec clang-format -i --verbose {} +
|
||||
find . -type f -name '*.h' ! -path './lib/*' ! -path './gcklib/*' -exec clang-format -i --verbose {} +
|
||||
else
|
||||
find . -type f -name '*.c' ! -path './lib/*' ! -path './gcklib/*' -exec clang-format -i {} +
|
||||
find . -type f -name '*.h' ! -path './lib/*' ! -path './gcklib/*' -exec clang-format -i {} +
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user