We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c7bc09 commit 67b664eCopy full SHA for 67b664e
src/bin/cargo/main.rs
@@ -31,9 +31,19 @@ fn main() {
31
32
let nightly_features_allowed = matches!(&*features::channel(), "nightly" | "dev");
33
if nightly_features_allowed {
34
+ let args = std::env::args_os();
35
+ let current_dir = std::env::current_dir().ok();
36
let completer =
37
clap_complete::CompleteEnv::with_factory(|| cli::cli(&mut gctx)).var("CARGO_COMPLETE");
- completer.complete();
38
+ if completer
39
+ .try_complete(args, current_dir.as_deref())
40
+ .unwrap_or_else(|e| {
41
+ let mut shell = Shell::new();
42
+ cargo::exit_with_error(e.into(), &mut shell)
43
+ })
44
+ {
45
+ return;
46
+ }
47
}
48
49
let result = if let Some(lock_addr) = cargo::ops::fix_get_proxy_lock_addr() {
0 commit comments