@@ -28,18 +28,18 @@ pub fn get_arg_parser() -> Command {
28
28
. short ( 'v' )
29
29
. default_value ( "info" )
30
30
. value_parser ( [ "debug" , "info" ] )
31
- . long_help (
31
+ . help (
32
32
"This controls the action's verbosity in the workflow's logs.
33
33
This option does not affect the verbosity of resulting
34
- thread comments or file annotations." ,
34
+ thread comments or file annotations.\n \n " ,
35
35
) ,
36
36
)
37
37
. arg (
38
38
Arg :: new ( "database" )
39
39
. long ( "database" )
40
40
. short ( 'p' )
41
41
. help_heading ( "clang-tidy options" )
42
- . long_help (
42
+ . help (
43
43
"The path that is used to read a compile command database.
44
44
For example, it can be a CMake build directory in which a file named
45
45
compile_commands.json exists (set `CMAKE_EXPORT_COMPILE_COMMANDS` to `ON`).
@@ -54,13 +54,13 @@ for an example of setting up Clang Tooling on a source tree.",
54
54
. long ( "style" )
55
55
. default_value ( "llvm" )
56
56
. help_heading ( "clang-format options" )
57
- . long_help (
57
+ . help (
58
58
"The style rules to use.
59
59
60
60
- Set this to `file` to have clang-format use the closest relative
61
61
.clang-format file.
62
62
- Set this to a blank string (`''`) to disable using clang-format
63
- entirely." ,
63
+ entirely.\n \n " ,
64
64
) ,
65
65
)
66
66
. arg (
@@ -71,7 +71,7 @@ for an example of setting up Clang Tooling on a source tree.",
71
71
"boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*" ,
72
72
)
73
73
. help_heading ( "clang-tidy options" )
74
- . long_help (
74
+ . help (
75
75
"A comma-separated list of globs with optional `-` prefix.
76
76
Globs are processed in order of appearance in the list.
77
77
Globs without `-` prefix add checks with matching names to the set,
@@ -84,7 +84,7 @@ option in a .clang-tidy file (if any).
84
84
- It is also possible to rely solely on a .clang-tidy config file by
85
85
specifying this option as a blank string (`''`).
86
86
87
- See also clang-tidy docs for more info." ,
87
+ See also clang-tidy docs for more info.\n \n " ,
88
88
) ,
89
89
)
90
90
. arg (
@@ -95,15 +95,15 @@ See also clang-tidy docs for more info.",
95
95
. num_args ( 0 ..=1 )
96
96
. require_equals ( true )
97
97
. default_value ( "" )
98
- . long_help (
98
+ . help (
99
99
"The desired version of the clang tools to use. Accepted options are
100
100
strings which can be 8, 9, 10, 11, 12, 13, 14, 15, 16, 17.
101
101
102
102
- Set this option to a blank string (`''`) to use the
103
103
platform's default installed version.
104
104
- This value can also be a path to where the clang tools are
105
105
installed (if using a custom install location). All paths specified
106
- here are converted to absolute." ,
106
+ here are converted to absolute.\n \n " ,
107
107
) ,
108
108
)
109
109
. arg (
@@ -112,19 +112,19 @@ strings which can be 8, 9, 10, 11, 12, 13, 14, 15, 16, 17.
112
112
. long ( "extensions" )
113
113
. value_delimiter ( ',' )
114
114
. default_value ( "c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx" )
115
- . help_heading ( "source options" )
116
- . long_help ( "A comma-separated list of file extensions to analyze." ) ,
115
+ . help_heading ( "Source options" )
116
+ . help ( "A comma-separated list of file extensions to analyze.\n " ) ,
117
117
)
118
118
. arg (
119
119
Arg :: new ( "repo-root" )
120
120
. short ( 'r' )
121
121
. long ( "repo-root" )
122
122
. default_value ( "." )
123
- . help_heading ( "source options" )
124
- . long_help (
123
+ . help_heading ( "Source options" )
124
+ . help (
125
125
"The relative path to the repository root directory. This path is
126
126
relative to the runner's `GITHUB_WORKSPACE` environment variable (or
127
- the current working directory if not using a CI runner)." ,
127
+ the current working directory if not using a CI runner).\n \n " ,
128
128
) ,
129
129
)
130
130
. arg (
@@ -133,8 +133,8 @@ the current working directory if not using a CI runner).",
133
133
. long ( "ignore" )
134
134
. value_delimiter ( '|' )
135
135
. default_value ( ".github|target" )
136
- . help_heading ( "source options" )
137
- . long_help (
136
+ . help_heading ( "Source options" )
137
+ . help (
138
138
"Set this option with path(s) to ignore (or not ignore).
139
139
140
140
- In the case of multiple paths, you can use `|` to separate each path.
@@ -147,7 +147,7 @@ the current working directory if not using a CI runner).",
147
147
- Prefix a path with `!` to explicitly not ignore it. This can be
148
148
applied to a submodule's path (if desired) but not hidden directories.
149
149
- Glob patterns are not supported here. All asterisk characters (`*`)
150
- are literal." ,
150
+ are literal.\n \n " ,
151
151
) ,
152
152
)
153
153
. arg (
@@ -157,9 +157,9 @@ the current working directory if not using a CI runner).",
157
157
. value_delimiter ( '|' )
158
158
. default_value ( "" )
159
159
. help_heading ( "clang-tidy options" )
160
- . long_help (
160
+ . help (
161
161
"Similar to [`--ignore`](#-i---ignore) but applied
162
- exclusively to files analyzed by clang-tidy." ,
162
+ exclusively to files analyzed by clang-tidy.\n \n " ,
163
163
) ,
164
164
)
165
165
. arg (
@@ -169,9 +169,9 @@ exclusively to files analyzed by clang-tidy.",
169
169
. value_delimiter ( '|' )
170
170
. default_value ( "" )
171
171
. help_heading ( "clang-format options" )
172
- . long_help (
172
+ . help (
173
173
"Similar to [`--ignore`](#-i---ignore) but applied
174
- exclusively to files analyzed by clang-format." ,
174
+ exclusively to files analyzed by clang-format.\n \n " ,
175
175
) ,
176
176
)
177
177
. arg (
@@ -180,15 +180,15 @@ exclusively to files analyzed by clang-format.",
180
180
. long ( "lines-changed-only" )
181
181
. value_parser ( [ "true" , "false" , "diff" ] )
182
182
. default_value ( "true" )
183
- . help_heading ( "source options" )
184
- . long_help (
183
+ . help_heading ( "Source options" )
184
+ . help (
185
185
"This controls what part of the files are analyzed.
186
186
The following values are accepted:
187
187
188
188
- `false`: All lines in a file are analyzed.
189
189
- `true`: Only lines in the diff that contain additions are analyzed.
190
190
- `diff`: All lines in the diff are analyzed (including unchanged
191
- lines but not subtractions)." ,
191
+ lines but not subtractions).\n \n " ,
192
192
) ,
193
193
)
194
194
. arg (
@@ -198,8 +198,8 @@ The following values are accepted:
198
198
. default_value_if ( "lines-changed-only" , ArgPredicate :: Equals ( "true" . into ( ) ) , "true" )
199
199
. default_value ( "false" )
200
200
. value_parser ( FalseyValueParser :: new ( ) )
201
- . help_heading ( "source options" )
202
- . long_help (
201
+ . help_heading ( "Source options" )
202
+ . help (
203
203
"Set this option to false to analyze any source files in the repo.
204
204
This is automatically enabled if
205
205
[`--lines-changed-only`](#-l---lines-changed-only) is enabled.
@@ -210,7 +210,7 @@ This is automatically enabled if
210
210
> does not not have the privilege to list the changed files for an event.
211
211
>
212
212
> See [Authenticating with the `GITHUB_TOKEN`](
213
- > https://docs.github.com/en/actions/reference/authentication-in-a-workflow)." ,
213
+ > https://docs.github.com/en/actions/reference/authentication-in-a-workflow).\n \n " ,
214
214
) ,
215
215
)
216
216
. arg (
@@ -219,7 +219,7 @@ This is automatically enabled if
219
219
. short ( 'x' )
220
220
. action ( ArgAction :: Append )
221
221
. help_heading ( "clang-tidy options" )
222
- . long_help (
222
+ . help (
223
223
"A string of extra arguments passed to clang-tidy for use as
224
224
compiler arguments. This can be specified more than once for each
225
225
additional argument. Recommend using quotes around the value and
@@ -237,7 +237,7 @@ cpp-linter --extra-arg=\"-std=c++17\" --extra-arg=\"-Wall\"
237
237
. value_parser ( [ "true" , "false" , "updated" ] )
238
238
. default_value ( "false" )
239
239
. help_heading ( "feedback options" )
240
- . long_help (
240
+ . help (
241
241
"Set this option to true to enable the use of thread comments as feedback.
242
242
Set this to `update` to update an existing comment if one exists;
243
243
the value 'true' will always delete an old comment and post a new one if necessary.
@@ -248,7 +248,7 @@ the value 'true' will always delete an old comment and post a new one if necessa
248
248
> variable.
249
249
>
250
250
> See [Authenticating with the `GITHUB_TOKEN`](
251
- > https://docs.github.com/en/actions/reference/authentication-in-a-workflow)." ,
251
+ > https://docs.github.com/en/actions/reference/authentication-in-a-workflow).\n \n " ,
252
252
) ,
253
253
)
254
254
. arg (
@@ -258,13 +258,13 @@ the value 'true' will always delete an old comment and post a new one if necessa
258
258
. value_parser ( FalseyValueParser :: new ( ) )
259
259
. default_value ( "true" )
260
260
. help_heading ( "feedback options" )
261
- . long_help (
261
+ . help (
262
262
"Set this option to true or false to enable or disable the use of a
263
263
thread comment that basically says 'Looks Good To Me' (when all checks pass).
264
264
265
265
> [!important]
266
266
> The [`--thread-comments`](#-g---thread-comments)
267
- > option also notes further implications." ,
267
+ > option also notes further implications.\n \n " ,
268
268
) ,
269
269
)
270
270
. arg (
@@ -274,9 +274,9 @@ thread comment that basically says 'Looks Good To Me' (when all checks pass).
274
274
. value_parser ( FalseyValueParser :: new ( ) )
275
275
. default_value ( "false" )
276
276
. help_heading ( "feedback options" )
277
- . long_help (
277
+ . help (
278
278
"Set this option to true or false to enable or disable the use of
279
- a workflow step summary when the run has concluded." ,
279
+ a workflow step summary when the run has concluded.\n \n " ,
280
280
) ,
281
281
)
282
282
. arg (
@@ -286,11 +286,21 @@ a workflow step summary when the run has concluded.",
286
286
. value_parser ( FalseyValueParser :: new ( ) )
287
287
. default_value ( "true" )
288
288
. help_heading ( "feedback options" )
289
- . long_help (
289
+ . help (
290
290
"Set this option to false to disable the use of
291
- file annotations as feedback." ,
291
+ file annotations as feedback.\n \n " ,
292
292
) ,
293
293
)
294
+ . arg (
295
+ Arg :: new ( "files" )
296
+ . action ( ArgAction :: Append )
297
+ . help (
298
+ "An explicit path to a file.
299
+ This can be specified zero or more times, resulting in a list of files.
300
+ The list of files is appended to the internal list of 'not ignored' files.
301
+ Further filtering can still be applied (see [Source options](#source-options))." ,
302
+ )
303
+ )
294
304
. groups ( [
295
305
ArgGroup :: new ( "Clang-tidy options" )
296
306
. args ( [ "tidy-checks" , "database" , "extra-arg" , "ignore-tidy" ] ) ,
@@ -301,6 +311,7 @@ file annotations as feedback.",
301
311
"thread-comments" , "no-lgtm" , "step-summary" , "file-annotations"
302
312
] ) ,
303
313
] )
314
+ . next_line_help ( true )
304
315
}
305
316
306
317
/// Converts the parsed value of the `--extra-arg` option into an optional vector of strings.
0 commit comments