File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ Example uses:
7777 "Ignore `rust-version` specification in packages (unstable)"
7878 ) ,
7979 ] )
80- . arg_manifest_path ( )
80+ . arg_manifest_path_without_unsupported_path_tip ( )
8181 . arg_package ( "Package to modify" )
8282 . arg_dry_run ( "Don't actually write the manifest" )
8383 . arg_quiet ( )
Original file line number Diff line number Diff line change @@ -267,6 +267,20 @@ pub trait CommandExt: Sized {
267267 }
268268
269269 fn arg_manifest_path ( self ) -> Self {
270+ // We use `--manifest-path` instead of `--path`.
271+ let unsupported_path_arg = {
272+ let value_parser = UnknownArgumentValueParser :: suggest_arg ( "--manifest-path" ) ;
273+ flag ( "unsupported-path-flag" , "" )
274+ . long ( "path" )
275+ . value_parser ( value_parser)
276+ . hide ( true )
277+ } ;
278+ self . arg_manifest_path_without_unsupported_path_tip ( )
279+ . _arg ( unsupported_path_arg)
280+ }
281+
282+ // `cargo add` has a `--path` flag to install a crate from a local path.
283+ fn arg_manifest_path_without_unsupported_path_tip ( self ) -> Self {
270284 self . _arg (
271285 opt ( "manifest-path" , "Path to Cargo.toml" )
272286 . value_name ( "PATH" )
Original file line number Diff line number Diff line change @@ -218,6 +218,8 @@ fn cargo_compile_with_wrong_manifest_path_flag() {
218218 "\
219219 error: unexpected argument '--path' found
220220
221+ tip: a similar argument exists: '--manifest-path'
222+
221223Usage: cargo[EXE] build [OPTIONS]
222224
223225For more information, try '--help'.
You can’t perform that action at this time.
0 commit comments