Skip to content

Commit

Permalink
Merge pull request #372 from ozwaldorf/fix-complete-quoting
Browse files Browse the repository at this point in the history
fix(complete shell): remove quotes for zsh/bash raw, remove duplicated quotes in bash file and dir
  • Loading branch information
pacak authored Jul 16, 2024
2 parents a479b6b + 181e906 commit 1ae97ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/complete_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub(crate) fn render_zsh(
ShellComp::File { mask: Some(mask) } => writeln!(res, "_files -g {}", Shell(mask)),
ShellComp::Dir { mask: None } => writeln!(res, "_files -/"),
ShellComp::Dir { mask: Some(mask) } => writeln!(res, "_files -/ -g {}", Shell(mask)),
ShellComp::Raw { zsh, .. } => writeln!(res, "{}", Shell(zsh)),
ShellComp::Raw { zsh, .. } => writeln!(res, "{}", zsh),
ShellComp::Nothing => Ok(()),
}?;
}
Expand Down Expand Up @@ -194,13 +194,13 @@ pub(crate) fn render_bash(
match op {
ShellComp::File { mask: None } => write!(res, "_filedir"),
ShellComp::File { mask: Some(mask) } => {
writeln!(res, "_filedir '{}'", Shell(bashmask(mask)))
writeln!(res, "_filedir {}", Shell(bashmask(mask)))
}
ShellComp::Dir { mask: None } => write!(res, "_filedir -d"),
ShellComp::Dir { mask: Some(mask) } => {
writeln!(res, "_filedir -d '{}'", Shell(bashmask(mask)))
writeln!(res, "_filedir -d {}", Shell(bashmask(mask)))
}
ShellComp::Raw { bash, .. } => writeln!(res, "{}", Shell(bash)),
ShellComp::Raw { bash, .. } => writeln!(res, "{}", bash),
ShellComp::Nothing => Ok(()),
}?;
}
Expand Down

0 comments on commit 1ae97ed

Please sign in to comment.