Skip to content

Commit 7f00295

Browse files
authored
feat: add oma provides path completer (#629)
1 parent 092da84 commit 7f00295

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/subcommand/contents_find.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::table::oma_display_with_normal_output;
33
use crate::utils::pkgnames_completions;
44
use crate::{config::Config, error::OutputError};
55
use clap::Args;
6-
use clap_complete::ArgValueCompleter;
6+
use clap_complete::{ArgValueCompleter, PathCompleter};
77
use indexmap::IndexSet;
88
use oma_contents::searcher::{Mode, search};
99
use std::io::{Write, stdout};
@@ -60,7 +60,11 @@ impl CliExecuter for Files {
6060
#[derive(Debug, Args)]
6161
pub struct Provides {
6262
/// Search for package(s) that contains the specified path or file
63-
#[arg(help_heading = &**crate::args::ARG_HELP_HEADING_MUST, help = fl!("clap-contents-provides-help"))]
63+
#[arg(
64+
help_heading = &**crate::args::ARG_HELP_HEADING_MUST,
65+
help = fl!("clap-contents-provides-help"),
66+
add = ArgValueCompleter::new(PathCompleter::file())
67+
)]
6468
pattern: String,
6569
/// Search binary of package(s)
6670
#[arg(long, help = fl!("clap-contents-find-bin-help"))]

0 commit comments

Comments
 (0)