From 780b4a18281b6f7f7071e1b9db2290fae653c406 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Tue, 25 Oct 2016 10:34:46 -0400 Subject: [PATCH 1/2] fix(Fish Completions): fixes a bug where single quotes are not escaped Closes #704 --- src/completions/fish.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/completions/fish.rs b/src/completions/fish.rs index f398bfa3..a83e2e96 100644 --- a/src/completions/fish.rs +++ b/src/completions/fish.rs @@ -58,7 +58,7 @@ fn gen_fish_inner(root_command: &str, // -f # don't use file completion // -n "__fish_using_command myprog subcmd1" # complete for command "myprog subcmd1" - let basic_template = format!("complete -c {} -n '__fish_using_command {}'", + let basic_template = format!("complete -c {} -n \"__fish_using_command {}\"", root_command, parent_cmds); @@ -71,10 +71,10 @@ fn gen_fish_inner(root_command: &str, template.push_str(format!(" -l {}", data).as_str()); } if let Some(data) = option.help { - template.push_str(format!(" -d '{}'", data).as_str()); + template.push_str(format!(" -d \"{}\"", data).as_str()); } if let Some(ref data) = option.possible_vals { - template.push_str(format!(" -r -f -a '{}'", data.join(" ")).as_str()); + template.push_str(format!(" -r -f -a \"{}\"", data.join(" ")).as_str()); } buffer.push_str(template.as_str()); buffer.push_str("\n"); @@ -89,7 +89,7 @@ fn gen_fish_inner(root_command: &str, template.push_str(format!(" -l {}", data).as_str()); } if let Some(data) = flag.help { - template.push_str(format!(" -d '{}'", data).as_str()); + template.push_str(format!(" -d \"{}\"", data).as_str()); } buffer.push_str(template.as_str()); buffer.push_str("\n"); @@ -98,7 +98,7 @@ fn gen_fish_inner(root_command: &str, for subcommand in &comp_gen.p.subcommands { let mut template = basic_template.clone(); template.push_str(" -f"); - template.push_str(format!(" -a '{}'", &subcommand.p.meta.name).as_str()); + template.push_str(format!(" -a \"{}\"", &subcommand.p.meta.name).as_str()); buffer.push_str(template.as_str()); buffer.push_str("\n"); } From 2663ba774363dcdb580e49c4fd877cc3277e40b7 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Tue, 25 Oct 2016 10:37:57 -0400 Subject: [PATCH 2/2] chore: increase version --- CHANGELOG.md | 9 +++++++++ Cargo.toml | 2 +- README.md | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd73d145..fcf25c2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ + +### v2.16.2 (2016-10-25) + + +#### Bug Fixes + +* **Fish Completions:** fixes a bug where single quotes are not escaped ([780b4a18](https://github.com/kbknapp/clap-rs/commit/780b4a18281b6f7f7071e1b9db2290fae653c406), closes [#704](https://github.com/kbknapp/clap-rs/issues/704)) + + ### v2.16.1 (2016-10-24) diff --git a/Cargo.toml b/Cargo.toml index cf12f470..ea161b11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap" -version = "2.16.1" +version = "2.16.2" authors = ["Kevin K. "] exclude = ["examples/*", "clap-test/*", "tests/*", "benches/*", "*.png", "clap-perf/*", "*.dot"] repository = "https://github.com/kbknapp/clap-rs.git" diff --git a/README.md b/README.md index 4f1ef3da..6794499f 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,12 @@ Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc) ## What's New +Here's the highlights for v2.16.2 + +* Fixes a bug where single quotes are not escaped + +Here's the highlights for v2.16.1 + * **Help Message:** fixes a regression bug where args with multiple(true) threw off alignment Here's the highlights for v2.16.0