Skip to content

Commit

Permalink
Merge pull request #5666 from epage/dyn
Browse files Browse the repository at this point in the history
fix(complete)!: Remove unused CommandCompleter trait method
  • Loading branch information
epage committed Aug 11, 2024
2 parents 2633817 + 158e716 commit 2d8138a
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions clap_complete/src/dynamic/shells/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ impl CompleteArgs {
/// lives in [`CommandCompleter::write_complete`].
#[cfg(feature = "unstable-command")]
pub trait CommandCompleter {
/// The recommended file name for the registration code
fn file_name(&self, name: &str) -> String;
/// Register for completions
///
/// Write the `buf` the logic needed for calling into `<cmd> complete`, passing needed
Expand Down Expand Up @@ -264,9 +262,6 @@ pub trait CommandCompleter {
}

impl CommandCompleter for Shell {
fn file_name(&self, name: &str) -> String {
shell_completer(self).file_name(name)
}
fn write_registration(
&self,
name: &str,
Expand Down Expand Up @@ -298,9 +293,6 @@ fn shell_completer(shell: &Shell) -> &dyn CommandCompleter {
}

impl CommandCompleter for super::Bash {
fn file_name(&self, name: &str) -> String {
format!("{name}.bash")
}
fn write_registration(
&self,
name: &str,
Expand Down Expand Up @@ -418,9 +410,6 @@ impl Default for CompType {
}
}
impl CommandCompleter for super::Elvish {
fn file_name(&self, name: &str) -> String {
format!("{name}.elv")
}
fn write_registration(
&self,
_name: &str,
Expand Down Expand Up @@ -474,9 +463,6 @@ set edit:completion:arg-completer[BIN] = { |@words|
}

impl CommandCompleter for super::Fish {
fn file_name(&self, name: &str) -> String {
format!("{name}.fish")
}
fn write_registration(
&self,
_name: &str,
Expand Down Expand Up @@ -519,10 +505,6 @@ impl CommandCompleter for super::Fish {
}

impl CommandCompleter for super::Powershell {
fn file_name(&self, name: &str) -> String {
format!("{name}.ps1")
}

fn write_registration(
&self,
_name: &str,
Expand Down Expand Up @@ -585,9 +567,6 @@ Register-ArgumentCompleter -Native -CommandName {bin} -ScriptBlock {{
}

impl CommandCompleter for super::Zsh {
fn file_name(&self, name: &str) -> String {
format!("{name}.zsh")
}
fn write_registration(
&self,
_name: &str,
Expand Down

0 comments on commit 2d8138a

Please sign in to comment.