diff --git a/format_code.cmd b/format_code.cmd new file mode 100644 index 0000000..3c8fdb3 --- /dev/null +++ b/format_code.cmd @@ -0,0 +1,10 @@ +@echo off +echo Formatting all C/C++ files recursively... + +for /r %%i in (*.cpp *.h *.hpp *.cc *.c) do ( + echo Formatting: %%i + clang-format -i -style=file "%%i" +) + +echo Formatting complete! +pause diff --git a/format_code.sh b/format_code.sh new file mode 100644 index 0000000..a608441 --- /dev/null +++ b/format_code.sh @@ -0,0 +1,11 @@ +#!/bin/bash +echo "Formatting all C/C++ files recursively..." + +# Find and format files using an optimized execution loop +find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -o -name "*.cc" -o -name "*.c" \) -exec echo "Formatting: {}" \; -exec clang-format -style=file -i {} \; + +echo "Formatting complete!" + +# Pause analog: waits for a single keypress (-n 1) and hides the input (-s) +echo "Press any key to continue . . ." +read -n 1 -s -r \ No newline at end of file