We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
--lockfile-path
1 parent 7ea222d commit ad2b1eeCopy full SHA for ad2b1ee
src/cargo/util/command_prelude.rs
@@ -345,7 +345,22 @@ pub trait CommandExt: Sized {
345
self._arg(
346
opt("lockfile-path", "Path to Cargo.lock (unstable)")
347
.value_name("PATH")
348
- .help_heading(heading::MANIFEST_OPTIONS),
+ .help_heading(heading::MANIFEST_OPTIONS)
349
+ .add(clap_complete::engine::ArgValueCompleter::new(
350
+ clap_complete::engine::PathCompleter::any().filter(|path: &Path| {
351
+ let file_name = match path.file_name() {
352
+ Some(name) => name,
353
+ None => return false,
354
+ };
355
+
356
+ // allow directories
357
+ if path.is_dir() {
358
+ return true;
359
+ }
360
+ // allow `Cargo.lock` file
361
+ file_name == OsStr::new("Cargo.lock")
362
+ }),
363
+ )),
364
)
365
}
366
0 commit comments