Skip to content

Commit

Permalink
Update to clap_complete 4.5.16 and enforce exact dependency because o…
Browse files Browse the repository at this point in the history
…f unstable features
  • Loading branch information
Toorero committed Aug 13, 2024
1 parent 1ae439d commit cd8bd9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path = "src/lib.rs"

[dependencies]
clap = { version = "4.4.10", features = ["derive"] }
clap_complete = { version = "4.5.2", features = ["unstable-dynamic"] }
clap_complete = { version = "=4.5.16", features = ["unstable-dynamic", "unstable-command"] }
console = "0.15.7"
nu-ansi-term = "0.50.0"
reedline = "0.32.0"
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{ffi::OsString, marker::PhantomData, path::PathBuf, str::FromStr};

use clap::Parser;
use clap::{Parser, Subcommand};
use console::style;
use nu_ansi_term::{Color, Style};

Expand Down Expand Up @@ -31,7 +31,7 @@ struct ReedCompleter<C: Parser + Send + Sync + 'static> {
impl<C: Parser + Send + Sync + 'static> reedline::Completer for ReedCompleter<C> {
fn complete(&mut self, line: &str, pos: usize) -> Vec<reedline::Suggestion> {
let cmd = C::command();
let mut cmd = clap_complete::dynamic::shells::CompleteCommand::augment_subcommands(cmd);
let mut cmd = clap_complete::dynamic::command::CompleteCommand::augment_subcommands(cmd);
let args = Shlex::new(line);
let mut args = std::iter::once("".to_owned())
.chain(args)
Expand All @@ -53,8 +53,8 @@ impl<C: Parser + Send + Sync + 'static> reedline::Completer for ReedCompleter<C>
candidates
.into_iter()
.map(|c| reedline::Suggestion {
value: c.0.to_string_lossy().into_owned(),
description: c.1.map(|x| x.to_string()),
value: c.get_content().to_string_lossy().into_owned(),
description: c.get_help().map(|x| x.to_string()),
style: None,
extra: None,
span,
Expand Down

0 comments on commit cd8bd9a

Please sign in to comment.