File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,11 @@ it to allow or deny lints, eg.:
136
136
#[cfg_attr(feature = "cargo-clippy", allow(needless_lifetimes))]
137
137
"# ;
138
138
139
+ #[ allow( print_stdout) ]
140
+ fn show_help ( ) {
141
+ println ! ( "{}" , CARGO_CLIPPY_HELP ) ;
142
+ }
143
+
139
144
pub fn main ( ) {
140
145
use std:: env;
141
146
@@ -165,12 +170,9 @@ pub fn main() {
165
170
if let Some ( "clippy" ) = std:: env:: args ( ) . nth ( 1 ) . as_ref ( ) . map ( AsRef :: as_ref) {
166
171
// this arm is executed on the initial call to `cargo clippy`
167
172
168
- match std:: env:: args ( ) . nth ( 2 ) . as_ref ( ) . map ( AsRef :: as_ref) {
169
- Some ( "--help" ) | Some ( "-h" ) => {
170
- println ! ( "{}" , CARGO_CLIPPY_HELP ) ;
171
- return ;
172
- }
173
- _ => ( ) ,
173
+ if std:: env:: args ( ) . any ( |a| a == "--help" || a == "-h" ) {
174
+ show_help ( ) ;
175
+ return ;
174
176
}
175
177
176
178
let manifest_path_arg = std:: env:: args ( ) . skip ( 2 ) . find ( |val| val. starts_with ( "--manifest-path=" ) ) ;
You can’t perform that action at this time.
0 commit comments