Skip to content

Commit e06e018

Browse files
committed
feat: add completions for add --path
1 parent 4a8fd9b commit e06e018

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/bin/cargo/commands/add.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ Example uses:
100100
.value_name("PATH")
101101
.help("Filesystem path to local crate to add")
102102
.group("selected")
103-
.conflicts_with("git"),
103+
.conflicts_with("git")
104+
.add(clap_complete::engine::ArgValueCompleter::new(
105+
clap_complete::engine::PathCompleter::any()
106+
.filter(|path| path.join("Cargo.toml").exists()),
107+
)),
104108
clap::Arg::new("base")
105109
.long("base")
106110
.action(ArgAction::Set)

0 commit comments

Comments
 (0)