Skip to content

Commit 27a748b

Browse files
committed
fixup! fixup! feat(cli): Enable dynamic completions
1 parent 37c7c70 commit 27a748b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/bin/git-warp-time.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn main() -> Result<()> {
5050
.ignored(matches.get_flag("ignored"))
5151
.ignore_older(matches.get_flag("ignore_older"))
5252
.verbose(!matches.get_flag("quiet"));
53-
if let Some(completions) = cli.complete {
53+
if let Some(completions) = cli._complete {
5454
completions.complete(&mut Cli::command());
5555
} else {
5656
if matches.contains_id("paths") {

src/cli.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use clap_complete::dynamic::{ArgValueCompleter, CompleteCommand, CompletionCandi
1111
pub struct Cli {
1212
/// generate completions
1313
#[command(subcommand)]
14-
pub complete: Option<CompleteCommand>,
14+
pub _complete: Option<CompleteCommand>,
1515

1616
/// Include files tracked by Git but modifications in the working tee
1717
#[clap(short, long)]
@@ -30,10 +30,10 @@ pub struct Cli {
3030
pub quiet: bool,
3131

3232
/// Optional list of paths to operate on instead of default which is all files tracked by Git
33-
//#[clap(value_hint = clap::ValueHint::FilePath)]
34-
#[clap(add = ArgValueCompleter::new(|| { vec![
35-
CompletionCandidate::new("foo"),
36-
CompletionCandidate::new("bar"),
37-
CompletionCandidate::new("baz")] }))]
33+
#[clap(value_hint = clap::ValueHint::FilePath)]
34+
//#[clap(add = ArgValueCompleter::new(|| { vec![
35+
// CompletionCandidate::new("foo"),
36+
// CompletionCandidate::new("bar"),
37+
// CompletionCandidate::new("baz")] }))]
3838
pub paths: Vec<String>,
3939
}

0 commit comments

Comments
 (0)