From 0e185b922ed1e0fd653de00b4cd8d567d72ff68e Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Wed, 10 Jan 2018 19:44:35 +0200 Subject: [PATCH 01/14] fix(completions/zsh.zsh): Remove redundant code from output Fixes #1142 --- src/completions/mod.rs | 7 +------ tests/completions.rs | 7 ------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/completions/mod.rs b/src/completions/mod.rs index 026b4493..742c6161 100644 --- a/src/completions/mod.rs +++ b/src/completions/mod.rs @@ -91,12 +91,7 @@ pub fn subcommands_of(p: &Parser) -> Vec<(String, String)> { p.has_subcommands() ); if !p.has_subcommands() { - let mut ret = vec![ - ( - p.meta.name.clone(), - p.meta.bin_name.as_ref().unwrap().clone(), - ), - ]; + let mut ret = vec![]; debugln!("subcommands_of: Looking for aliases..."); if let Some(ref aliases) = p.meta.aliases { for &(n, _) in aliases { diff --git a/tests/completions.rs b/tests/completions.rs index 91c454b1..84018c8b 100644 --- a/tests/completions.rs +++ b/tests/completions.rs @@ -675,13 +675,6 @@ _my_app() { } -(( $+functions[_my_app_commands] )) || -_my_app_commands() { - local commands; commands=( - - ) - _describe -t commands 'my_app commands' commands "$@" -} (( $+functions[_my_app_commands] )) || _my_app_commands() { local commands; commands=( From b83f387b8065bf280a925e23541db4605b98d6b6 Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Wed, 10 Jan 2018 21:01:21 -0800 Subject: [PATCH 02/14] Fix typo --- src/app/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/mod.rs b/src/app/mod.rs index 908e1717..0a27cb36 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1304,7 +1304,7 @@ impl<'a, 'b> App<'a, 'b> { /// Generate a completions file for a specified shell at compile time. /// - /// **NOTE:** to generate the this file at compile time you must use a `build.rs` "Build Script" + /// **NOTE:** to generate the file at compile time you must use a `build.rs` "Build Script" /// /// # Examples /// From cc341243f33a99c30842a6df1a7cb5c5f08ebfcc Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Wed, 10 Jan 2018 21:49:40 -0800 Subject: [PATCH 03/14] Fix typos --- examples/19_auto_authors.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/19_auto_authors.rs b/examples/19_auto_authors.rs index c96eec4e..afbb9853 100644 --- a/examples/19_auto_authors.rs +++ b/examples/19_auto_authors.rs @@ -10,6 +10,6 @@ fn main() { .author(crate_authors!()) .get_matches(); - // running the this app with the -h will display whatever author(s) are in your + // running this app with -h will display whatever author(s) are in your // Cargo.toml -} \ No newline at end of file +} From e39aeab8487596046fbdbc6a226e5c8820585245 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Sat, 13 Jan 2018 20:06:59 +0200 Subject: [PATCH 04/14] feat(completions/zsh.rs): Complete positional arguments properly This changes the way we complete positionals to complete them using _arguments, as should be done, instead of completing their uppercase name as a string. Currently I made it offer _files completion for all positional arguments. This can be improved to complete actual possible values of the arguments and only complete files if the argument truly takes them. But this will require further changes in clap to actually have the required functionality to get this information. --- src/completions/zsh.rs | 49 +++++++++++++++++++++++++----------------- tests/completions.rs | 8 +++---- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/src/completions/zsh.rs b/src/completions/zsh.rs index c73a9878..3e9452d1 100644 --- a/src/completions/zsh.rs +++ b/src/completions/zsh.rs @@ -167,24 +167,6 @@ fn subcommands_and_args_of(p: &Parser) -> String { } } - // Then the positional args - for arg in p.positionals() { - debugln!("ZshGen::subcommands_and_args_of:iter: arg={}", arg.b.name); - let a = format!( - "\"{name}:{help}\" \\", - name = arg.b.name.to_ascii_uppercase(), - help = arg.b - .help - .unwrap_or("") - .replace("[", "\\[") - .replace("]", "\\]") - ); - - if !a.is_empty() { - ret.push(a); - } - } - ret.join("\n") } @@ -293,9 +275,10 @@ fn get_args_of(p: &Parser) -> String { let mut ret = vec![String::from("_arguments -s -S -C \\")]; let opts = write_opts_of(p); let flags = write_flags_of(p); - let sc_or_a = if p.has_subcommands() || p.has_positionals() { + let positionals = write_positionals_of(p); + let sc_or_a = if p.has_subcommands() { format!( - "\"1:: :_{name}_commands\" \\", + "\":: :_{name}_commands\" \\", name = p.meta.bin_name.as_ref().unwrap().replace(" ", "__") ) } else { @@ -313,6 +296,9 @@ fn get_args_of(p: &Parser) -> String { if !flags.is_empty() { ret.push(flags); } + if !positionals.is_empty() { + ret.push(positionals); + } if !sc_or_a.is_empty() { ret.push(sc_or_a); } @@ -434,3 +420,26 @@ fn write_flags_of(p: &Parser) -> String { ret.join("\n") } + +fn write_positionals_of(p: &Parser) -> String { + debugln!("write_positionals_of;"); + let mut ret = vec![]; + for arg in p.positionals() { + debugln!("write_positionals_of:iter: arg={}", arg.b.name); + let a = format!( + "\"{optional}:{name}{help}:_files\" \\", + optional = if !arg.b.is_set(ArgSettings::Required) { ":" } else { "" }, + name = arg.b.name, + help = arg.b + .help + .map_or("".to_owned(), |v| " -- ".to_owned() + v) + .replace("[", "\\[") + .replace("]", "\\]") + ); + + debugln!("write_positionals_of:iter: Wrote...{}", a); + ret.push(a); + } + + ret.join("\n") +} diff --git a/tests/completions.rs b/tests/completions.rs index 91c454b1..c90b91b8 100644 --- a/tests/completions.rs +++ b/tests/completions.rs @@ -99,7 +99,8 @@ _myapp() { '--help[Prints help information]' \ '-V[Prints version information]' \ '--version[Prints version information]' \ -"1:: :_myapp_commands" \ +"::file -- some input file:_files" \ +":: :_myapp_commands" \ "*:: :->myapp" \ && ret=0 case $state in @@ -133,7 +134,6 @@ _myapp_commands() { local commands; commands=( "test:tests things" \ "help:Prints this message or the help of the given subcommand(s)" \ -"FILE:some input file" \ ) _describe -t commands 'myapp commands' commands "$@" } @@ -388,7 +388,8 @@ _my_app() { '--help[Prints help information]' \ '-V[Prints version information]' \ '--version[Prints version information]' \ -"1:: :_my_app_commands" \ +"::file -- some input file:_files" \ +":: :_my_app_commands" \ "*:: :->my_app" \ && ret=0 case $state in @@ -441,7 +442,6 @@ _my_app_commands() { "some_cmd:tests other things" \ "some-cmd-with-hypens:" \ "help:Prints this message or the help of the given subcommand(s)" \ -"FILE:some input file" \ ) _describe -t commands 'my_app commands' commands "$@" } From 1146f0da154d6796fbfcb09db8efa3593cb0d898 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Sat, 13 Jan 2018 20:49:20 +0200 Subject: [PATCH 05/14] fix(completions/zsh.rs): Maybe fix completions with mixed positionals and subcommands Optional positionals mixed with subcommands will still break this, since I can't see how to tell which element of $line is the command than. Mixing optional positionals with subcommands is a bit weird and awkward though... --- src/completions/zsh.rs | 11 +++++++---- tests/completions.rs | 16 ++++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/completions/zsh.rs b/src/completions/zsh.rs index 3e9452d1..057e05fe 100644 --- a/src/completions/zsh.rs +++ b/src/completions/zsh.rs @@ -230,15 +230,18 @@ fn get_subcommands_of(p: &Parser) -> String { format!( "case $state in ({name}) - curcontext=\"${{curcontext%:*:*}}:{name_hyphen}-command-$words[1]:\" - case $line[1] in + words=($line[{pos}] \"${{words[@]}}\") + (( CURRENT += 1 )) + curcontext=\"${{curcontext%:*:*}}:{name_hyphen}-command-$line[{pos}]:\" + case $line[{pos}] in {subcommands} esac ;; esac", name = p.meta.name, name_hyphen = p.meta.bin_name.as_ref().unwrap().replace(" ", "-"), - subcommands = subcmds.join("\n") + subcommands = subcmds.join("\n"), + pos = p.positionals().len() + 1 ) } @@ -285,7 +288,7 @@ fn get_args_of(p: &Parser) -> String { String::new() }; let sc = if p.has_subcommands() { - format!("\"*:: :->{name}\" \\", name = p.meta.name) + format!("\"*::: :->{name}\" \\", name = p.meta.name) } else { String::new() }; diff --git a/tests/completions.rs b/tests/completions.rs index c90b91b8..fc343ee5 100644 --- a/tests/completions.rs +++ b/tests/completions.rs @@ -101,12 +101,14 @@ _myapp() { '--version[Prints version information]' \ "::file -- some input file:_files" \ ":: :_myapp_commands" \ -"*:: :->myapp" \ +"*::: :->myapp" \ && ret=0 case $state in (myapp) - curcontext="${curcontext%:*:*}:myapp-command-$words[1]:" - case $line[1] in + words=($line[2] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:myapp-command-$line[2]:" + case $line[2] in (test) _arguments -s -S -C \ '--case=[the case to test]' \ @@ -390,12 +392,14 @@ _my_app() { '--version[Prints version information]' \ "::file -- some input file:_files" \ ":: :_my_app_commands" \ -"*:: :->my_app" \ +"*::: :->my_app" \ && ret=0 case $state in (my_app) - curcontext="${curcontext%:*:*}:my_app-command-$words[1]:" - case $line[1] in + words=($line[2] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:my_app-command-$line[2]:" + case $line[2] in (test) _arguments -s -S -C \ '--case=[the case to test]' \ From 16b4f143ff466b7ef18a267bc44ade0f9639109b Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Sat, 13 Jan 2018 20:56:58 +0200 Subject: [PATCH 06/14] fix(completions/zsh.rs): Don't pass -S to _arguments if Zsh is too old If you do pass it than _arguments considers -C as a possible option in the completions. --- src/completions/zsh.rs | 9 ++++++++- tests/completions.rs | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/completions/zsh.rs b/src/completions/zsh.rs index 057e05fe..8f926173 100644 --- a/src/completions/zsh.rs +++ b/src/completions/zsh.rs @@ -33,8 +33,15 @@ impl<'a, 'b> ZshGen<'a, 'b> { _{name}() {{ typeset -A opt_args + typeset -a _arguments_options local ret=1 + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + local context curcontext=\"$curcontext\" state line {initial_args} {subcommands} @@ -275,7 +282,7 @@ fn parser_of<'a, 'b>(p: &'b Parser<'a, 'b>, sc: &str) -> &'b Parser<'a, 'b> { // -S: Do not complete anything after '--' and treat those as argument values fn get_args_of(p: &Parser) -> String { debugln!("get_args_of;"); - let mut ret = vec![String::from("_arguments -s -S -C \\")]; + let mut ret = vec![String::from("_arguments \"${_arguments_options[@]}\" \\")]; let opts = write_opts_of(p); let flags = write_flags_of(p); let positionals = write_positionals_of(p); diff --git a/tests/completions.rs b/tests/completions.rs index fc343ee5..84088b07 100644 --- a/tests/completions.rs +++ b/tests/completions.rs @@ -91,10 +91,17 @@ static ZSH: &'static str = r#"#compdef myapp _myapp() { typeset -A opt_args + typeset -a _arguments_options local ret=1 + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + local context curcontext="$curcontext" state line - _arguments -s -S -C \ + _arguments "${_arguments_options[@]}" \ '-h[Prints help information]' \ '--help[Prints help information]' \ '-V[Prints version information]' \ @@ -110,7 +117,7 @@ _myapp() { curcontext="${curcontext%:*:*}:myapp-command-$line[2]:" case $line[2] in (test) -_arguments -s -S -C \ +_arguments "${_arguments_options[@]}" \ '--case=[the case to test]' \ '-h[Prints help information]' \ '--help[Prints help information]' \ @@ -119,7 +126,7 @@ _arguments -s -S -C \ && ret=0 ;; (help) -_arguments -s -S -C \ +_arguments "${_arguments_options[@]}" \ '-h[Prints help information]' \ '--help[Prints help information]' \ '-V[Prints version information]' \ @@ -382,10 +389,17 @@ static ZSH_SPECIAL_CMDS: &'static str = r#"#compdef my_app _my_app() { typeset -A opt_args + typeset -a _arguments_options local ret=1 + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + local context curcontext="$curcontext" state line - _arguments -s -S -C \ + _arguments "${_arguments_options[@]}" \ '-h[Prints help information]' \ '--help[Prints help information]' \ '-V[Prints version information]' \ @@ -401,7 +415,7 @@ _my_app() { curcontext="${curcontext%:*:*}:my_app-command-$line[2]:" case $line[2] in (test) -_arguments -s -S -C \ +_arguments "${_arguments_options[@]}" \ '--case=[the case to test]' \ '-h[Prints help information]' \ '--help[Prints help information]' \ @@ -410,7 +424,7 @@ _arguments -s -S -C \ && ret=0 ;; (some_cmd) -_arguments -s -S -C \ +_arguments "${_arguments_options[@]}" \ '--config=[the other case to test]' \ '-h[Prints help information]' \ '--help[Prints help information]' \ @@ -419,7 +433,7 @@ _arguments -s -S -C \ && ret=0 ;; (some-cmd-with-hypens) -_arguments -s -S -C \ +_arguments "${_arguments_options[@]}" \ '-h[Prints help information]' \ '--help[Prints help information]' \ '-V[Prints version information]' \ @@ -427,7 +441,7 @@ _arguments -s -S -C \ && ret=0 ;; (help) -_arguments -s -S -C \ +_arguments "${_arguments_options[@]}" \ '-h[Prints help information]' \ '--help[Prints help information]' \ '-V[Prints version information]' \ @@ -661,10 +675,17 @@ static ZSH_SPECIAL_HELP: &'static str = r#"#compdef my_app _my_app() { typeset -A opt_args + typeset -a _arguments_options local ret=1 + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + local context curcontext="$curcontext" state line - _arguments -s -S -C \ + _arguments "${_arguments_options[@]}" \ '--single-quotes[Can be '\''always'\'', '\''auto'\'', or '\''never'\'']' \ '--double-quotes[Can be "always", "auto", or "never"]' \ '--backticks[For more information see `echo test`]' \ From a652260795d1519f6ec2a7a09ccc1258499cad7b Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Mon, 15 Jan 2018 20:19:36 +0200 Subject: [PATCH 07/14] fix(completions/zsh.rs): Add missing autoload for is-at-least --- src/completions/zsh.rs | 2 ++ tests/completions.rs | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/completions/zsh.rs b/src/completions/zsh.rs index 8f926173..2b086996 100644 --- a/src/completions/zsh.rs +++ b/src/completions/zsh.rs @@ -31,6 +31,8 @@ impl<'a, 'b> ZshGen<'a, 'b> { "\ #compdef {name} +autoload -U is-at-least + _{name}() {{ typeset -A opt_args typeset -a _arguments_options diff --git a/tests/completions.rs b/tests/completions.rs index 6eb25acc..862a9d12 100644 --- a/tests/completions.rs +++ b/tests/completions.rs @@ -89,6 +89,8 @@ complete -F _myapp -o bashdefault -o default myapp static ZSH: &'static str = r#"#compdef myapp +autoload -U is-at-least + _myapp() { typeset -A opt_args typeset -a _arguments_options @@ -387,6 +389,8 @@ static POWERSHELL_SPECIAL_CMDS: &'static str = r#" static ZSH_SPECIAL_CMDS: &'static str = r#"#compdef my_app +autoload -U is-at-least + _my_app() { typeset -A opt_args typeset -a _arguments_options @@ -673,6 +677,8 @@ complete -c my_app -n "__fish_using_command my_app" -s V -l version -d 'Prints v static ZSH_SPECIAL_HELP: &'static str = r#"#compdef my_app +autoload -U is-at-least + _my_app() { typeset -A opt_args typeset -a _arguments_options From f3b0afd2bef8b7be97162f8a7802ddf7603dff36 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Mon, 15 Jan 2018 21:47:26 +0200 Subject: [PATCH 08/14] feat(completions/zsh.rs): Implement postional argument possible values completion --- src/completions/zsh.rs | 26 ++++++++++++++++++++------ tests/completions.rs | 4 ++-- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/completions/zsh.rs b/src/completions/zsh.rs index 2b086996..099a2157 100644 --- a/src/completions/zsh.rs +++ b/src/completions/zsh.rs @@ -322,8 +322,8 @@ fn get_args_of(p: &Parser) -> String { ret.join("\n") } -// Escape string inside single quotes and brackets -fn escape_string(string: &str) -> String { +// Escape help string inside single quotes and brackets +fn escape_help(string: &str) -> String { string .replace("\\", "\\\\") .replace("'", "'\\''") @@ -331,12 +331,22 @@ fn escape_string(string: &str) -> String { .replace("]", "\\]") } +// Escape value string inside single quotes and parentheses +fn escape_value(string: &str) -> String { + string + .replace("\\", "\\\\") + .replace("'", "'\\''") + .replace("(", "\\(") + .replace(")", "\\)") + .replace(" ", "\\ ") +} + fn write_opts_of(p: &Parser) -> String { debugln!("write_opts_of;"); let mut ret = vec![]; for o in p.opts() { debugln!("write_opts_of:iter: o={}", o.name()); - let help = o.help().map_or(String::new(), escape_string); + let help = o.help().map_or(String::new(), escape_help); let mut conflicts = get_zsh_arg_conflicts!(p, o, INTERNAL_ERROR_MSG); conflicts = if conflicts.is_empty() { String::new() @@ -390,7 +400,7 @@ fn write_flags_of(p: &Parser) -> String { let mut ret = vec![]; for f in p.flags() { debugln!("write_flags_of:iter: f={}", f.name()); - let help = f.help().map_or(String::new(), escape_string); + let help = f.help().map_or(String::new(), escape_help); let mut conflicts = get_zsh_arg_conflicts!(p, f, INTERNAL_ERROR_MSG); conflicts = if conflicts.is_empty() { String::new() @@ -439,14 +449,18 @@ fn write_positionals_of(p: &Parser) -> String { for arg in p.positionals() { debugln!("write_positionals_of:iter: arg={}", arg.b.name); let a = format!( - "\"{optional}:{name}{help}:_files\" \\", + "'{optional}:{name}{help}:{action}' \\", optional = if !arg.b.is_set(ArgSettings::Required) { ":" } else { "" }, name = arg.b.name, help = arg.b .help .map_or("".to_owned(), |v| " -- ".to_owned() + v) .replace("[", "\\[") - .replace("]", "\\]") + .replace("]", "\\]"), + action = arg.possible_vals().map_or("_files".to_owned(), |values| { + format!("({})", + values.iter().map(|v| escape_value(*v)).collect::>().join(" ")) + }) ); debugln!("write_positionals_of:iter: Wrote...{}", a); diff --git a/tests/completions.rs b/tests/completions.rs index 862a9d12..f25f9429 100644 --- a/tests/completions.rs +++ b/tests/completions.rs @@ -108,7 +108,7 @@ _myapp() { '--help[Prints help information]' \ '-V[Prints version information]' \ '--version[Prints version information]' \ -"::file -- some input file:_files" \ +'::file -- some input file:_files' \ ":: :_myapp_commands" \ "*::: :->myapp" \ && ret=0 @@ -408,7 +408,7 @@ _my_app() { '--help[Prints help information]' \ '-V[Prints version information]' \ '--version[Prints version information]' \ -"::file -- some input file:_files" \ +'::file -- some input file:_files' \ ":: :_my_app_commands" \ "*::: :->my_app" \ && ret=0 From 2cbbfa8ce979b945acb64c21c27ef92fcddf73ca Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Mon, 15 Jan 2018 22:01:39 +0200 Subject: [PATCH 09/14] style(completions/zsh.rs): Cleanup documentation and naming --- src/completions/zsh.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/completions/zsh.rs b/src/completions/zsh.rs index 099a2157..cca18985 100644 --- a/src/completions/zsh.rs +++ b/src/completions/zsh.rs @@ -61,7 +61,7 @@ _{name} \"$@\"", } } -// Displays the positional args and commands of a subcommand +// Displays the commands of a subcommand // (( $+functions[_[bin_name_underscore]_commands] )) || // _[bin_name_underscore]_commands() { // local commands; commands=( @@ -72,8 +72,8 @@ _{name} \"$@\"", // Where the following variables are present: // [bin_name_underscore]: The full space deliniated bin_name, where spaces have been replaced by // underscore characters -// [arg_name]: The name of the positional arg or subcommand -// [arg_help]: The help message of the arg or subcommand +// [arg_name]: The name of the subcommand +// [arg_help]: The help message of the subcommand // [bin_name]: The full space deliniated bin_name // // Here's a snippet from rustup: @@ -103,7 +103,7 @@ _{bin_name_underscore}_commands() {{ }}", bin_name_underscore = p.meta.bin_name.as_ref().unwrap().replace(" ", "__"), bin_name = p.meta.bin_name.as_ref().unwrap(), - subcommands_and_args = subcommands_and_args_of(p) + subcommands_and_args = subcommands_of(p) ), ]; @@ -124,26 +124,26 @@ _{bin_name_underscore}_commands() {{ }}", bin_name_underscore = bin_name.replace(" ", "__"), bin_name = bin_name, - subcommands_and_args = subcommands_and_args_of(parser_of(p, bin_name)) + subcommands_and_args = subcommands_of(parser_of(p, bin_name)) )); } ret.join("\n") } -// Generates subcommand and positional argument completions in form of +// Generates subcommand completions in form of // // '[arg_name]:[arg_help]' // // Where: -// [arg_name]: the argument or subcommand's name -// [arg_help]: the help message of the argument or subcommand +// [arg_name]: the subcommand's name +// [arg_help]: the help message of the subcommand // // A snippet from rustup: // 'show:Show the active and installed toolchains' // 'update:Update Rust toolchains' -fn subcommands_and_args_of(p: &Parser) -> String { - debugln!("ZshGen::subcommands_and_args_of;"); +fn subcommands_of(p: &Parser) -> String { + debugln!("ZshGen::subcommands_of;"); let mut ret = vec![]; fn add_sc(sc: &App, n: &str, ret: &mut Vec) { debugln!("ZshGen::add_sc;"); @@ -162,10 +162,10 @@ fn subcommands_and_args_of(p: &Parser) -> String { } } - // First the subcommands + // The subcommands for sc in p.subcommands() { debugln!( - "ZshGen::subcommands_and_args_of:iter: subcommand={}", + "ZshGen::subcommands_of:iter: subcommand={}", sc.p.meta.name ); add_sc(sc, &sc.p.meta.name, &mut ret); @@ -262,8 +262,8 @@ fn parser_of<'a, 'b>(p: &'b Parser<'a, 'b>, sc: &str) -> &'b Parser<'a, 'b> { &p.find_subcommand(sc).expect(INTERNAL_ERROR_MSG).p } -// Writes out the args section, which ends up being the flags and opts, and a jump to -// another ZSH function if there are positional args or subcommands. +// Writes out the args section, which ends up being the flags, opts and postionals, and a jump to +// another ZSH function if there are subcommands. // The structer works like this: // ([conflicting_args]) [multiple] arg [takes_value] [[help]] [: :(possible_values)] // ^-- list '-v -h' ^--'*' ^--'+' ^-- list 'one two three' @@ -274,8 +274,8 @@ fn parser_of<'a, 'b>(p: &'b Parser<'a, 'b>, sc: &str) -> &'b Parser<'a, 'b> { // '(-h --help --verbose)-v[Enable verbose output]' \ // '(-V -v --version --verbose --help)-h[Prints help information]' \ // # ... snip for brevity -// '1:: :_rustup_commands' \ # <-- displays positional args and subcommands -// '*:: :->rustup' \ # <-- displays subcommand args and child subcommands +// ':: :_rustup_commands' \ # <-- displays subcommands +// '*::: :->rustup' \ # <-- displays subcommand args and child subcommands // && ret=0 // // The args used for _arguments are as follows: From 25561decf147d329b64634a14d9695673c2fc78f Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Tue, 16 Jan 2018 01:55:48 +0200 Subject: [PATCH 10/14] feat(completions/zsh.rs): Escape possible values for options --- src/completions/zsh.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/completions/zsh.rs b/src/completions/zsh.rs index cca18985..11dd868e 100644 --- a/src/completions/zsh.rs +++ b/src/completions/zsh.rs @@ -360,7 +360,8 @@ fn write_opts_of(p: &Parser) -> String { "" }; let pv = if let Some(pv_vec) = o.possible_vals() { - format!(": :({})", pv_vec.join(" ")) + format!(": :({})", pv_vec.iter().map( + |v| escape_value(*v)).collect::>().join(" ")) } else { String::new() }; From 0abcb80694f04c8c35f26b4e0ba14d5eed6be2fb Mon Sep 17 00:00:00 2001 From: Kevin K Date: Mon, 15 Jan 2018 23:29:55 -0500 Subject: [PATCH 11/14] chore(SPONSORS.md): adds the latest sponsor! Yay --- SPONSORS.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SPONSORS.md b/SPONSORS.md index 397e005a..d55b9ca5 100644 --- a/SPONSORS.md +++ b/SPONSORS.md @@ -1,7 +1,10 @@ -The following is a list of [sponsors](https://www.clap.rs/sponsor/) for the clap-rs project: +The following is a list of [sponsors](https://clap.rs/sponsorship/) for the clap-rs project: -[Noelia Seva-Gonzalez](http://vsgrealestategroup.com.realproserver.com/About) +[Noelia Seva-Gonzalez](https://noeliasg.com/about/) Noelia Seva-Gonzalez -[Rob Tsuk](https://github.com/rtsuk) -Rob Tsuk \ No newline at end of file +[Rob Tsuk](https://github.com/rtsuk) +Rob Tsuk + +[messense](https://github.com/messense) +Messense From eb9269a23bbf76f5d60f0233168058825a35e6c2 Mon Sep 17 00:00:00 2001 From: Jaanus Varus Date: Tue, 16 Jan 2018 19:54:14 +0100 Subject: [PATCH 12/14] Fix doc typo in 14_groups.rs --- examples/14_groups.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/14_groups.rs b/examples/14_groups.rs index 71b43c0f..4b62f66a 100644 --- a/examples/14_groups.rs +++ b/examples/14_groups.rs @@ -1,6 +1,6 @@ /// `ArgGroup`s are a family of related arguments and way for you to say, "Any of these arguments". /// By placing arguments in a logical group, you can make easier requirement and exclusion rules -/// intead of having to list each individually, or when you want a rule to apply "any but not all" +/// instead of having to list each individually, or when you want a rule to apply "any but not all" /// arguments. /// /// For instance, you can make an entire ArgGroup required, this means that one (and *only* one) From df996822c8dcd0946467fcfcac3f82ce5fcb2fbb Mon Sep 17 00:00:00 2001 From: Kevin K Date: Tue, 16 Jan 2018 15:01:53 -0500 Subject: [PATCH 13/14] chore: increase version --- CHANGELOG.md | 21 ++++++++++++++ CONTRIBUTORS.md | 74 ++++++++++++++++++++++++------------------------- Cargo.toml | 4 +-- README.md | 11 ++++++++ 4 files changed, 71 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03431f23..844dc5b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ + +### v2.29.2 (2018-01-16) + + +#### Features + +* **completions/zsh.rs:** + * Escape possible values for options ([25561dec](https://github.com/kbknapp/clap-rs/commit/25561decf147d329b64634a14d9695673c2fc78f)) + * Implement postional argument possible values completion ([f3b0afd2](https://github.com/kbknapp/clap-rs/commit/f3b0afd2bef8b7be97162f8a7802ddf7603dff36)) + * Complete positional arguments properly ([e39aeab8](https://github.com/kbknapp/clap-rs/commit/e39aeab8487596046fbdbc6a226e5c8820585245)) + +#### Bug Fixes + +* **completions/zsh.rs:** + * Add missing autoload for is-at-least ([a6522607](https://github.com/kbknapp/clap-rs/commit/a652260795d1519f6ec2a7a09ccc1258499cad7b)) + * Don't pass -S to _arguments if Zsh is too old ([16b4f143](https://github.com/kbknapp/clap-rs/commit/16b4f143ff466b7ef18a267bc44ade0f9639109b)) + * Maybe fix completions with mixed positionals and subcommands ([1146f0da](https://github.com/kbknapp/clap-rs/commit/1146f0da154d6796fbfcb09db8efa3593cb0d898)) +* **completions/zsh.zsh:** Remove redundant code from output ([0e185b92](https://github.com/kbknapp/clap-rs/commit/0e185b922ed1e0fd653de00b4cd8d567d72ff68e), closes [#1142](https://github.com/kbknapp/clap-rs/issues/1142)) + + + ### 2.29.1 (2018-01-09) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c4f23859..8899cd36 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -9,77 +9,77 @@ the following is a list of contributors: :---: |:---: |:---: |:---: |:---: |:---: | [willmurphyscode](https://github.com/willmurphyscode) |[mgeisler](https://github.com/mgeisler) |[nabijaczleweli](https://github.com/nabijaczleweli) |[Byron](https://github.com/Byron) |[hgrecco](https://github.com/hgrecco) |[bluejekyll](https://github.com/bluejekyll) | -[ignatenkobrain](https://github.com/ignatenkobrain) |[james-darkfox](https://github.com/james-darkfox) |[H2CO3](https://github.com/H2CO3) |[nateozem](https://github.com/nateozem) |[glowing-chemist](https://github.com/glowing-chemist) |[rtaycher](https://github.com/rtaycher) | +[segevfiner](https://github.com/segevfiner) |[ignatenkobrain](https://github.com/ignatenkobrain) |[james-darkfox](https://github.com/james-darkfox) |[H2CO3](https://github.com/H2CO3) |[nateozem](https://github.com/nateozem) |[glowing-chemist](https://github.com/glowing-chemist) | :---: |:---: |:---: |:---: |:---: |:---: | -[ignatenkobrain](https://github.com/ignatenkobrain) |[james-darkfox](https://github.com/james-darkfox) |[H2CO3](https://github.com/H2CO3) |[nateozem](https://github.com/nateozem) |[glowing-chemist](https://github.com/glowing-chemist) |[rtaycher](https://github.com/rtaycher) | +[segevfiner](https://github.com/segevfiner) |[ignatenkobrain](https://github.com/ignatenkobrain) |[james-darkfox](https://github.com/james-darkfox) |[H2CO3](https://github.com/H2CO3) |[nateozem](https://github.com/nateozem) |[glowing-chemist](https://github.com/glowing-chemist) | -[Arnavion](https://github.com/Arnavion) |[japaric](https://github.com/japaric) |[untitaker](https://github.com/untitaker) |[afiune](https://github.com/afiune) |[crazymerlyn](https://github.com/crazymerlyn) |[SuperFluffy](https://github.com/SuperFluffy) | +[rtaycher](https://github.com/rtaycher) |[Arnavion](https://github.com/Arnavion) |[japaric](https://github.com/japaric) |[untitaker](https://github.com/untitaker) |[afiune](https://github.com/afiune) |[crazymerlyn](https://github.com/crazymerlyn) | :---: |:---: |:---: |:---: |:---: |:---: | -[Arnavion](https://github.com/Arnavion) |[japaric](https://github.com/japaric) |[untitaker](https://github.com/untitaker) |[afiune](https://github.com/afiune) |[crazymerlyn](https://github.com/crazymerlyn) |[SuperFluffy](https://github.com/SuperFluffy) | +[rtaycher](https://github.com/rtaycher) |[Arnavion](https://github.com/Arnavion) |[japaric](https://github.com/japaric) |[untitaker](https://github.com/untitaker) |[afiune](https://github.com/afiune) |[crazymerlyn](https://github.com/crazymerlyn) | -[matthiasbeyer](https://github.com/matthiasbeyer) |[malbarbo](https://github.com/malbarbo) |[tshepang](https://github.com/tshepang) |[golem131](https://github.com/golem131) |[jimmycuadra](https://github.com/jimmycuadra) |[Nemo157](https://github.com/Nemo157) | +[SuperFluffy](https://github.com/SuperFluffy) |[matthiasbeyer](https://github.com/matthiasbeyer) |[malbarbo](https://github.com/malbarbo) |[tshepang](https://github.com/tshepang) |[golem131](https://github.com/golem131) |[jimmycuadra](https://github.com/jimmycuadra) | :---: |:---: |:---: |:---: |:---: |:---: | -[matthiasbeyer](https://github.com/matthiasbeyer) |[malbarbo](https://github.com/malbarbo) |[tshepang](https://github.com/tshepang) |[golem131](https://github.com/golem131) |[jimmycuadra](https://github.com/jimmycuadra) |[Nemo157](https://github.com/Nemo157) | +[SuperFluffy](https://github.com/SuperFluffy) |[matthiasbeyer](https://github.com/matthiasbeyer) |[malbarbo](https://github.com/malbarbo) |[tshepang](https://github.com/tshepang) |[golem131](https://github.com/golem131) |[jimmycuadra](https://github.com/jimmycuadra) | -[severen](https://github.com/severen) |[Eijebong](https://github.com/Eijebong) |[cstorey](https://github.com/cstorey) |[wdv4758h](https://github.com/wdv4758h) |[frewsxcv](https://github.com/frewsxcv) |[hoodie](https://github.com/hoodie) | +[Nemo157](https://github.com/Nemo157) |[severen](https://github.com/severen) |[Eijebong](https://github.com/Eijebong) |[cstorey](https://github.com/cstorey) |[wdv4758h](https://github.com/wdv4758h) |[frewsxcv](https://github.com/frewsxcv) | :---: |:---: |:---: |:---: |:---: |:---: | -[severen](https://github.com/severen) |[Eijebong](https://github.com/Eijebong) |[cstorey](https://github.com/cstorey) |[wdv4758h](https://github.com/wdv4758h) |[frewsxcv](https://github.com/frewsxcv) |[hoodie](https://github.com/hoodie) | +[Nemo157](https://github.com/Nemo157) |[severen](https://github.com/severen) |[Eijebong](https://github.com/Eijebong) |[cstorey](https://github.com/cstorey) |[wdv4758h](https://github.com/wdv4758h) |[frewsxcv](https://github.com/frewsxcv) | -[huonw](https://github.com/huonw) |[GrappigPanda](https://github.com/GrappigPanda) |[shepmaster](https://github.com/shepmaster) |[porglezomp](https://github.com/porglezomp) |[kieraneglin](https://github.com/kieraneglin) |[musoke](https://github.com/musoke) | +[hoodie](https://github.com/hoodie) |[huonw](https://github.com/huonw) |[GrappigPanda](https://github.com/GrappigPanda) |[shepmaster](https://github.com/shepmaster) |[starkat99](https://github.com/starkat99) |[porglezomp](https://github.com/porglezomp) | :---: |:---: |:---: |:---: |:---: |:---: | -[huonw](https://github.com/huonw) |[GrappigPanda](https://github.com/GrappigPanda) |[shepmaster](https://github.com/shepmaster) |[porglezomp](https://github.com/porglezomp) |[kieraneglin](https://github.com/kieraneglin) |[musoke](https://github.com/musoke) | +[hoodie](https://github.com/hoodie) |[huonw](https://github.com/huonw) |[GrappigPanda](https://github.com/GrappigPanda) |[shepmaster](https://github.com/shepmaster) |[starkat99](https://github.com/starkat99) |[porglezomp](https://github.com/porglezomp) | -[nelsonjchen](https://github.com/nelsonjchen) |[pkgw](https://github.com/pkgw) |[Deedasmi](https://github.com/Deedasmi) |[vmchale](https://github.com/vmchale) |[messense](https://github.com/messense) |[Keats](https://github.com/Keats) | +[kraai](https://github.com/kraai) |[musoke](https://github.com/musoke) |[nelsonjchen](https://github.com/nelsonjchen) |[pkgw](https://github.com/pkgw) |[Deedasmi](https://github.com/Deedasmi) |[vmchale](https://github.com/vmchale) | :---: |:---: |:---: |:---: |:---: |:---: | -[nelsonjchen](https://github.com/nelsonjchen) |[pkgw](https://github.com/pkgw) |[Deedasmi](https://github.com/Deedasmi) |[vmchale](https://github.com/vmchale) |[messense](https://github.com/messense) |[Keats](https://github.com/Keats) | +[kraai](https://github.com/kraai) |[musoke](https://github.com/musoke) |[nelsonjchen](https://github.com/nelsonjchen) |[pkgw](https://github.com/pkgw) |[Deedasmi](https://github.com/Deedasmi) |[vmchale](https://github.com/vmchale) | -[starkat99](https://github.com/starkat99) |[durka](https://github.com/durka) |[alex-gulyas](https://github.com/alex-gulyas) |[cite-reader](https://github.com/cite-reader) |[alexbool](https://github.com/alexbool) |[AluisioASG](https://github.com/AluisioASG) | +[messense](https://github.com/messense) |[Keats](https://github.com/Keats) |[kieraneglin](https://github.com/kieraneglin) |[durka](https://github.com/durka) |[alex-gulyas](https://github.com/alex-gulyas) |[cite-reader](https://github.com/cite-reader) | :---: |:---: |:---: |:---: |:---: |:---: | -[starkat99](https://github.com/starkat99) |[durka](https://github.com/durka) |[alex-gulyas](https://github.com/alex-gulyas) |[cite-reader](https://github.com/cite-reader) |[alexbool](https://github.com/alexbool) |[AluisioASG](https://github.com/AluisioASG) | +[messense](https://github.com/messense) |[Keats](https://github.com/Keats) |[kieraneglin](https://github.com/kieraneglin) |[durka](https://github.com/durka) |[alex-gulyas](https://github.com/alex-gulyas) |[cite-reader](https://github.com/cite-reader) | -[BurntSushi](https://github.com/BurntSushi) |[nox](https://github.com/nox) |[mitsuhiko](https://github.com/mitsuhiko) |[brennie](https://github.com/brennie) |[ogham](https://github.com/ogham) |[pixelistik](https://github.com/pixelistik) | +[alexbool](https://github.com/alexbool) |[AluisioASG](https://github.com/AluisioASG) |[BurntSushi](https://github.com/BurntSushi) |[nox](https://github.com/nox) |[mitsuhiko](https://github.com/mitsuhiko) |[brennie](https://github.com/brennie) | :---: |:---: |:---: |:---: |:---: |:---: | -[BurntSushi](https://github.com/BurntSushi) |[nox](https://github.com/nox) |[mitsuhiko](https://github.com/mitsuhiko) |[brennie](https://github.com/brennie) |[ogham](https://github.com/ogham) |[pixelistik](https://github.com/pixelistik) | +[alexbool](https://github.com/alexbool) |[AluisioASG](https://github.com/AluisioASG) |[BurntSushi](https://github.com/BurntSushi) |[nox](https://github.com/nox) |[mitsuhiko](https://github.com/mitsuhiko) |[brennie](https://github.com/brennie) | -[dotdash](https://github.com/dotdash) |[bradurani](https://github.com/bradurani) |[Seeker14491](https://github.com/Seeker14491) |[brianp](https://github.com/brianp) |[cldershem](https://github.com/cldershem) |[casey](https://github.com/casey) | +[pixelistik](https://github.com/pixelistik) |[Bilalh](https://github.com/Bilalh) |[dotdash](https://github.com/dotdash) |[bradurani](https://github.com/bradurani) |[Seeker14491](https://github.com/Seeker14491) |[brianp](https://github.com/brianp) | :---: |:---: |:---: |:---: |:---: |:---: | -[dotdash](https://github.com/dotdash) |[bradurani](https://github.com/bradurani) |[Seeker14491](https://github.com/Seeker14491) |[brianp](https://github.com/brianp) |[cldershem](https://github.com/cldershem) |[casey](https://github.com/casey) | +[pixelistik](https://github.com/pixelistik) |[Bilalh](https://github.com/Bilalh) |[dotdash](https://github.com/dotdash) |[bradurani](https://github.com/bradurani) |[Seeker14491](https://github.com/Seeker14491) |[brianp](https://github.com/brianp) | -[volks73](https://github.com/volks73) |[daboross](https://github.com/daboross) |[mernen](https://github.com/mernen) |[dguo](https://github.com/dguo) |[davidszotten](https://github.com/davidszotten) |[drusellers](https://github.com/drusellers) | +[cldershem](https://github.com/cldershem) |[casey](https://github.com/casey) |[volks73](https://github.com/volks73) |[daboross](https://github.com/daboross) |[mernen](https://github.com/mernen) |[dguo](https://github.com/dguo) | :---: |:---: |:---: |:---: |:---: |:---: | -[volks73](https://github.com/volks73) |[daboross](https://github.com/daboross) |[mernen](https://github.com/mernen) |[dguo](https://github.com/dguo) |[davidszotten](https://github.com/davidszotten) |[drusellers](https://github.com/drusellers) | +[cldershem](https://github.com/cldershem) |[casey](https://github.com/casey) |[volks73](https://github.com/volks73) |[daboross](https://github.com/daboross) |[mernen](https://github.com/mernen) |[dguo](https://github.com/dguo) | -[eddyb](https://github.com/eddyb) |[Enet4](https://github.com/Enet4) |[Fraser999](https://github.com/Fraser999) |[birkenfeld](https://github.com/birkenfeld) |[guanqun](https://github.com/guanqun) |[tanakh](https://github.com/tanakh) | +[davidszotten](https://github.com/davidszotten) |[drusellers](https://github.com/drusellers) |[eddyb](https://github.com/eddyb) |[Enet4](https://github.com/Enet4) |[Fraser999](https://github.com/Fraser999) |[birkenfeld](https://github.com/birkenfeld) | :---: |:---: |:---: |:---: |:---: |:---: | -[eddyb](https://github.com/eddyb) |[Enet4](https://github.com/Enet4) |[Fraser999](https://github.com/Fraser999) |[birkenfeld](https://github.com/birkenfeld) |[guanqun](https://github.com/guanqun) |[tanakh](https://github.com/tanakh) | +[davidszotten](https://github.com/davidszotten) |[drusellers](https://github.com/drusellers) |[eddyb](https://github.com/eddyb) |[Enet4](https://github.com/Enet4) |[Fraser999](https://github.com/Fraser999) |[birkenfeld](https://github.com/birkenfeld) | -[SirVer](https://github.com/SirVer) |[idmit](https://github.com/idmit) |[archer884](https://github.com/archer884) |[jacobmischka](https://github.com/jacobmischka) |[jespino](https://github.com/jespino) |[jfrankenau](https://github.com/jfrankenau) | +[guanqun](https://github.com/guanqun) |[tanakh](https://github.com/tanakh) |[SirVer](https://github.com/SirVer) |[idmit](https://github.com/idmit) |[archer884](https://github.com/archer884) |[discosultan](https://github.com/discosultan) | :---: |:---: |:---: |:---: |:---: |:---: | -[SirVer](https://github.com/SirVer) |[idmit](https://github.com/idmit) |[archer884](https://github.com/archer884) |[jacobmischka](https://github.com/jacobmischka) |[jespino](https://github.com/jespino) |[jfrankenau](https://github.com/jfrankenau) | +[guanqun](https://github.com/guanqun) |[tanakh](https://github.com/tanakh) |[SirVer](https://github.com/SirVer) |[idmit](https://github.com/idmit) |[archer884](https://github.com/archer884) |[discosultan](https://github.com/discosultan) | -[jtdowney](https://github.com/jtdowney) |[andete](https://github.com/andete) |[joshtriplett](https://github.com/joshtriplett) |[Kalwyn](https://github.com/Kalwyn) |[manuel-rhdt](https://github.com/manuel-rhdt) |[Marwes](https://github.com/Marwes) | +[jacobmischka](https://github.com/jacobmischka) |[jespino](https://github.com/jespino) |[jfrankenau](https://github.com/jfrankenau) |[jtdowney](https://github.com/jtdowney) |[andete](https://github.com/andete) |[joshtriplett](https://github.com/joshtriplett) | :---: |:---: |:---: |:---: |:---: |:---: | -[jtdowney](https://github.com/jtdowney) |[andete](https://github.com/andete) |[joshtriplett](https://github.com/joshtriplett) |[Kalwyn](https://github.com/Kalwyn) |[manuel-rhdt](https://github.com/manuel-rhdt) |[Marwes](https://github.com/Marwes) | +[jacobmischka](https://github.com/jacobmischka) |[jespino](https://github.com/jespino) |[jfrankenau](https://github.com/jfrankenau) |[jtdowney](https://github.com/jtdowney) |[andete](https://github.com/andete) |[joshtriplett](https://github.com/joshtriplett) | -[mdaffin](https://github.com/mdaffin) |[iliekturtles](https://github.com/iliekturtles) |[nicompte](https://github.com/nicompte) |[NickeZ](https://github.com/NickeZ) |[nvzqz](https://github.com/nvzqz) |[nuew](https://github.com/nuew) | +[Kalwyn](https://github.com/Kalwyn) |[manuel-rhdt](https://github.com/manuel-rhdt) |[Marwes](https://github.com/Marwes) |[mdaffin](https://github.com/mdaffin) |[iliekturtles](https://github.com/iliekturtles) |[nicompte](https://github.com/nicompte) | :---: |:---: |:---: |:---: |:---: |:---: | -[mdaffin](https://github.com/mdaffin) |[iliekturtles](https://github.com/iliekturtles) |[nicompte](https://github.com/nicompte) |[NickeZ](https://github.com/NickeZ) |[nvzqz](https://github.com/nvzqz) |[nuew](https://github.com/nuew) | +[Kalwyn](https://github.com/Kalwyn) |[manuel-rhdt](https://github.com/manuel-rhdt) |[Marwes](https://github.com/Marwes) |[mdaffin](https://github.com/mdaffin) |[iliekturtles](https://github.com/iliekturtles) |[nicompte](https://github.com/nicompte) | -[Geogi](https://github.com/Geogi) |[focusaurus](https://github.com/focusaurus) |[flying-sheep](https://github.com/flying-sheep) |[Phlosioneer](https://github.com/Phlosioneer) |[peppsac](https://github.com/peppsac) |[golddranks](https://github.com/golddranks) | +[NickeZ](https://github.com/NickeZ) |[nvzqz](https://github.com/nvzqz) |[nuew](https://github.com/nuew) |[Geogi](https://github.com/Geogi) |[focusaurus](https://github.com/focusaurus) |[flying-sheep](https://github.com/flying-sheep) | :---: |:---: |:---: |:---: |:---: |:---: | -[Geogi](https://github.com/Geogi) |[focusaurus](https://github.com/focusaurus) |[flying-sheep](https://github.com/flying-sheep) |[Phlosioneer](https://github.com/Phlosioneer) |[peppsac](https://github.com/peppsac) |[golddranks](https://github.com/golddranks) | +[NickeZ](https://github.com/NickeZ) |[nvzqz](https://github.com/nvzqz) |[nuew](https://github.com/nuew) |[Geogi](https://github.com/Geogi) |[focusaurus](https://github.com/focusaurus) |[flying-sheep](https://github.com/flying-sheep) | -[hexjelly](https://github.com/hexjelly) |[rom1v](https://github.com/rom1v) |[rnelson](https://github.com/rnelson) |[segevfiner](https://github.com/segevfiner) |[swatteau](https://github.com/swatteau) |[tspiteri](https://github.com/tspiteri) | +[Phlosioneer](https://github.com/Phlosioneer) |[peppsac](https://github.com/peppsac) |[golddranks](https://github.com/golddranks) |[hexjelly](https://github.com/hexjelly) |[rom1v](https://github.com/rom1v) |[rnelson](https://github.com/rnelson) | :---: |:---: |:---: |:---: |:---: |:---: | -[hexjelly](https://github.com/hexjelly) |[rom1v](https://github.com/rom1v) |[rnelson](https://github.com/rnelson) |[segevfiner](https://github.com/segevfiner) |[swatteau](https://github.com/swatteau) |[tspiteri](https://github.com/tspiteri) | +[Phlosioneer](https://github.com/Phlosioneer) |[peppsac](https://github.com/peppsac) |[golddranks](https://github.com/golddranks) |[hexjelly](https://github.com/hexjelly) |[rom1v](https://github.com/rom1v) |[rnelson](https://github.com/rnelson) | -[siiptuo](https://github.com/siiptuo) |[vks](https://github.com/vks) |[vsupalov](https://github.com/vsupalov) |[mineo](https://github.com/mineo) |[wabain](https://github.com/wabain) |[grossws](https://github.com/grossws) | +[swatteau](https://github.com/swatteau) |[tspiteri](https://github.com/tspiteri) |[siiptuo](https://github.com/siiptuo) |[vks](https://github.com/vks) |[vsupalov](https://github.com/vsupalov) |[mineo](https://github.com/mineo) | :---: |:---: |:---: |:---: |:---: |:---: | -[siiptuo](https://github.com/siiptuo) |[vks](https://github.com/vks) |[vsupalov](https://github.com/vsupalov) |[mineo](https://github.com/mineo) |[wabain](https://github.com/wabain) |[grossws](https://github.com/grossws) | +[swatteau](https://github.com/swatteau) |[tspiteri](https://github.com/tspiteri) |[siiptuo](https://github.com/siiptuo) |[vks](https://github.com/vks) |[vsupalov](https://github.com/vsupalov) |[mineo](https://github.com/mineo) | -[kennytm](https://github.com/kennytm) |[mvaude](https://github.com/mvaude) |[panicbit](https://github.com/panicbit) |[Bilalh](https://github.com/Bilalh) | -:---: |:---: |:---: |:---: | -[kennytm](https://github.com/kennytm) |[mvaude](https://github.com/mvaude) |[panicbit](https://github.com/panicbit) |[Bilalh](https://github.com/Bilalh) | +[wabain](https://github.com/wabain) |[grossws](https://github.com/grossws) |[kennytm](https://github.com/kennytm) |[mvaude](https://github.com/mvaude) |[panicbit](https://github.com/panicbit) |[ogham](https://github.com/ogham) | +:---: |:---: |:---: |:---: |:---: |:---: | +[wabain](https://github.com/wabain) |[grossws](https://github.com/grossws) |[kennytm](https://github.com/kennytm) |[mvaude](https://github.com/mvaude) |[panicbit](https://github.com/panicbit) |[ogham](https://github.com/ogham) | diff --git a/Cargo.toml b/Cargo.toml index 4c6bb773..603150d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap" -version = "2.29.1" +version = "2.29.2" authors = ["Kevin K. "] exclude = ["examples/*", "clap-test/*", "tests/*", "benches/*", "*.png", "clap-perf/*", "*.dot"] repository = "https://github.com/kbknapp/clap-rs" @@ -9,7 +9,7 @@ documentation = "https://docs.rs/clap/" homepage = "https://clap.rs/" readme = "README.md" license = "MIT" -keywords = ["argument", "command", "arg", "parser", "parse"] +keywords = ["argument", "cli", "arg", "parser", "parse"] categories = ["command-line-interface"] description = """ A simple to use, efficient, and full featured Command Line Argument Parser diff --git a/README.md b/README.md index 95969569..9601aaf3 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,17 @@ Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc) ## What's New +Here's whats new in 2.29.2: + +* **Many ZSH Completions Improvements** (Thanks to @segevfiner) + * Positional arguments will default to file completion when not using specific values! + * Implement postional argument possible values completion + * Removes redundant code from output + * Don't pass `-S` to `_arguments` if Zsh is too old + * Fix completions with mixed positionals and subcommands + * String escape possible values for options + + Here's whats new in 2.29.1: * Debloats clap by deduplicating logic and refactors for a ~57% decrease in code size! This is with zero functinoality lost, and a slight perf increase! From 5bb926ebf9df8e7bb85775a92a370d2bc33bc9b2 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Thu, 18 Jan 2018 15:06:23 -0500 Subject: [PATCH 14/14] chore: fix html_doc_root --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d60eddd7..ee4d885e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -513,7 +513,7 @@ //! this repository for more information. #![crate_type = "lib"] -#![doc(html_root_url = "https://docs.rs/clap/2.29.1")] +#![doc(html_root_url = "https://docs.rs/clap/2.29.2")] #![deny(missing_docs, missing_debug_implementations, missing_copy_implementations, trivial_casts, unused_import_braces, unused_allocation)] // Lints we'd like to deny but are currently failing for upstream crates