File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -232,10 +232,20 @@ pub trait CommandExt: Sized {
232
232
}
233
233
234
234
fn arg_target_triple ( self , target : & ' static str ) -> Self {
235
+ let unsupported_short_arg = {
236
+ let value_parser = UnknownArgumentValueParser :: suggest_arg ( "--target" ) ;
237
+ Arg :: new ( "unsupported-short-target-flag" )
238
+ . help ( "" )
239
+ . short ( 't' )
240
+ . value_parser ( value_parser)
241
+ . action ( ArgAction :: SetTrue )
242
+ . hide ( true )
243
+ } ;
235
244
self . _arg (
236
245
optional_multi_opt ( "target" , "TRIPLE" , target)
237
246
. help_heading ( heading:: COMPILATION_OPTIONS ) ,
238
247
)
248
+ . _arg ( unsupported_short_arg)
239
249
}
240
250
241
251
fn arg_target_dir ( self ) -> Self {
Original file line number Diff line number Diff line change @@ -4252,6 +4252,8 @@ fn cargo_build_with_unsupported_short_target_flag() {
4252
4252
"\
4253
4253
error: unexpected argument '-t' found
4254
4254
4255
+ tip: a similar argument exists: '--target'
4256
+
4255
4257
Usage: cargo[EXE] build [OPTIONS]
4256
4258
4257
4259
For more information, try '--help'.
You can’t perform that action at this time.
0 commit comments