Skip to content

Commit

Permalink
appease the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
wabo225 committed Feb 28, 2024
1 parent 9beccff commit cd6a394
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions clap_complete/src/shells/clink.rs
Expand Up @@ -53,7 +53,7 @@ fn generate_inner(p: &Command, depth: usize) -> String {

for flag in utils::flags(p) {
if let Some(shorts) = flag.get_short_and_visible_aliases() {
shorts.iter().for_each(|short| {
for short in shorts {
writeln!(b, "{}:addflags(\"-{}\")", indent, short).unwrap();
if let Some(help) = flag.get_help() {
writeln!(
Expand All @@ -63,10 +63,10 @@ fn generate_inner(p: &Command, depth: usize) -> String {
)
.unwrap();
}
});
}
}
if let Some(longs) = flag.get_long_and_visible_aliases() {
longs.iter().for_each(|long| {
for long in longs {
writeln!(b, "{}:addflags(\"--{}\")", indent, long).unwrap();
if let Some(help) = flag.get_help() {
writeln!(
Expand All @@ -76,7 +76,7 @@ fn generate_inner(p: &Command, depth: usize) -> String {
)
.unwrap();
}
});
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions clap_complete/src/shells/shell.rs
Expand Up @@ -23,7 +23,7 @@ pub enum Shell {
/// Z SHell (zsh)
Zsh,
/// Clink
Clink
Clink,
}

impl Display for Shell {
Expand Down Expand Up @@ -80,7 +80,7 @@ impl Generator for Shell {
Shell::Fish => shells::Fish.file_name(name),
Shell::PowerShell => shells::PowerShell.file_name(name),
Shell::Zsh => shells::Zsh.file_name(name),
Shell::Clink => shells::Clink.file_name(name)
Shell::Clink => shells::Clink.file_name(name),
}
}

Expand All @@ -91,7 +91,7 @@ impl Generator for Shell {
Shell::Fish => shells::Fish.generate(cmd, buf),
Shell::PowerShell => shells::PowerShell.generate(cmd, buf),
Shell::Zsh => shells::Zsh.generate(cmd, buf),
Shell::Clink => shells::Clink.generate(cmd, buf)
Shell::Clink => shells::Clink.generate(cmd, buf),
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions clap_complete/tests/testsuite/clink.rs
Expand Up @@ -4,5 +4,10 @@ use crate::common;
fn basic() {
let name = "my-app";
let cmd = common::basic_command(name);
common::assert_matches(snapbox::file!["../snapshots/basic.lua"], clap_complete::shells::Clink, cmd, name);
}
common::assert_matches(
snapbox::file!["../snapshots/basic.lua"],
clap_complete::shells::Clink,
cmd,
name,
);
}

0 comments on commit cd6a394

Please sign in to comment.