File tree 1 file changed +31
-6
lines changed
1 file changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,33 @@ source_dir="$(dirname "$script_dir")"
7
7
8
8
check_only=0
9
9
no_version_check=0
10
+ run_cpp=0
11
+ run_yaml=0
12
+ run_sh=0
13
+ run_cmake=0
14
+ run_all=1
10
15
11
16
while [[ " $# " -gt 0 ]]; do
12
17
case $1 in
13
18
-h | --help) help=1 ;;
14
19
--check-only) check_only=1 ;;
15
20
--no-version-check) no_version_check=1 ;;
21
+ --cpp)
22
+ run_cpp=1
23
+ run_all=0
24
+ ;;
25
+ --yaml)
26
+ run_yaml=1
27
+ run_all=0
28
+ ;;
29
+ --sh)
30
+ run_sh=1
31
+ run_all=0
32
+ ;;
33
+ --cmake)
34
+ run_cmake=1
35
+ run_all=0
36
+ ;;
16
37
--source)
17
38
source_dir=" $2 "
18
39
shift
@@ -26,12 +47,16 @@ if [ "$help" ]; then
26
47
cat << EOF
27
48
$me : Format or check formatting of files in this repo
28
49
29
- Usage: $me [--check-only] [--no-version-check] [--source <path>]
50
+ Usage: $me [--check-only] [--no-version-check] [--source <path>] [--cpp] [--yaml] [--sh] [--cmake]
30
51
31
52
Options:
32
53
--check-only Check formatting without modifying files
33
54
--no-version-check Skip version compatibility checks
34
- --source Path to source directory to format (defaults to parent of script directory)
55
+ --source Path to source directory to format (defaults to parent of script directory)
56
+ --cpp Format only C++ files
57
+ --yaml Format only YAML/JSON files
58
+ --sh Format only shell script files
59
+ --cmake Format only CMake files
35
60
EOF
36
61
exit 0
37
62
fi
@@ -166,9 +191,9 @@ sh_formatting() {
166
191
fi
167
192
}
168
193
169
- cmake_formatting
170
- cpp_formatting
171
- yaml_json_formatting
172
- sh_formatting
194
+ (( run_all || run_cmake )) && cmake_formatting
195
+ (( run_all || run_cpp )) && cpp_formatting
196
+ (( run_all || run_yaml )) && yaml_json_formatting
197
+ (( run_all || run_sh )) && sh_formatting
173
198
174
199
exit $exit_code
You can’t perform that action at this time.
0 commit comments