Skip to content

Commit

Permalink
Auto merge of #772 - kbknapp:issue-771, r=kbknapp
Browse files Browse the repository at this point in the history
Issue 771
  • Loading branch information
homu committed Dec 9, 2016
2 parents ff7febf + 7144419 commit ff5d1a7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
<a name="v2.19.2"></a>
### v2.19.2 (2016-12-08)

#### Bug Fixes

* **ZSH Completions:** escapes square brackets in ZSH completions ([7e17d5a3](https://github.com/kbknapp/clap-rs/commit/7e17d5a36b2cc2cc77e7b15796b14d639ed3cbf7), closes [#771](https://github.com/kbknapp/clap-rs/issues/771))

#### Documentation

* **Examples:** adds subcommand examples ([0e0f3354](https://github.com/kbknapp/clap-rs/commit/0e0f33547a6901425afc1d9fbe19f7ae3832d9a4), closes [#766](https://github.com/kbknapp/clap-rs/issues/766))
* **README.md:** adds guidance on when to use ~ in version pinning, and clarifies breaking change policy ([591eaefc](https://github.com/kbknapp/clap-rs/commit/591eaefc7319142ba921130e502bb0729feed907), closes [#765](https://github.com/kbknapp/clap-rs/issues/765))



<a name="v2.19.1"></a>
### v2.19.1 (2016-12-01)

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "clap"
version = "2.19.1"
version = "2.19.2"
authors = ["Kevin K. <[email protected]>"]
exclude = ["examples/*", "clap-test/*", "tests/*", "benches/*", "*.png", "clap-perf/*", "*.dot"]
repository = "https://github.com/kbknapp/clap-rs.git"
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)

## What's New

Here's the highlights for v2.19.1
Here's the highlights for v2.19.2

* **Help Messages:** fixes help message alignment when specific settings are used on options
* **Bash Completion:** allows bash completion to fall back to traidtional bash completion upon no matching completing function
* Fixes a bug by escaping square brackets in ZSH completions which were causing conflicts and errors.
* Adds subcommand examples (`examples/20_subcommands.rs`)
* Adds guidance on when to use ~ in version pinning, and clarifies breaking change policy


Here's the highlights from v2.0.0 to v2.19.0
Here's the highlights from v2.0.0 to v2.19.1

* **Bash Completion:** allows bash completion to fall back to traidtional bash completion upon no matching completing function
* **Arg Setting**: Allows specifying an `AllowLeadingHyphen` style setting for values only for specific args, vice command wide
* **Validators:** improves the error messages for validators
* **Required Unless:** fixes a bug where having required_unless set doesn't work when conflicts are also set
Expand Down
8 changes: 4 additions & 4 deletions src/completions/zsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn subcommands_and_args_of(p: &Parser) -> String {
fn add_sc(sc: &App, n: &str, ret: &mut Vec<String>) {
let s = format!("\"{name}:{help}\" \\",
name = n,
help = sc.p.meta.about.unwrap_or(""));
help = sc.p.meta.about.unwrap_or("").replace("[", "\\[").replace("]", "\\]"));
if !s.is_empty() {
ret.push(s);
}
Expand All @@ -151,7 +151,7 @@ fn subcommands_and_args_of(p: &Parser) -> String {
debugln!("iter;arg={}", arg.b.name);
let a = format!("\"{name}:{help}\" \\",
name = arg.b.name.to_ascii_uppercase(),
help = arg.b.help.unwrap_or(""));
help = arg.b.help.unwrap_or("").replace("[", "\\[").replace("]", "\\]"));

if !a.is_empty() {
ret.push(a);
Expand Down Expand Up @@ -299,7 +299,7 @@ fn write_opts_of(p: &Parser) -> String {
let mut ret = vec![];
for o in p.opts() {
debugln!("iter;o={}", o.name());
let help = o.help().unwrap_or("");
let help = o.help().unwrap_or("").replace("[", "\\[").replace("]", "\\]");
let mut conflicts = get_zsh_arg_conflicts!(p, o, INTERNAL_ERROR_MSG);
conflicts = if conflicts.is_empty() {
String::new()
Expand Down Expand Up @@ -349,7 +349,7 @@ fn write_flags_of(p: &Parser) -> String {
let mut ret = vec![];
for f in p.flags() {
debugln!("iter;f={}", f.name());
let help = f.help().unwrap_or("");
let help = f.help().unwrap_or("").replace("[", "\\[").replace("]", "\\]");
let mut conflicts = get_zsh_arg_conflicts!(p, f, INTERNAL_ERROR_MSG);
conflicts = if conflicts.is_empty() {
String::new()
Expand Down

0 comments on commit ff5d1a7

Please sign in to comment.