From 7daee9ded0d6343d1eed0aae0d8fa942883d7233 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Fri, 1 Jul 2016 00:25:01 -0400 Subject: [PATCH] chore: increase version --- CHANGELOG.md | 13 +++++++++++++ Cargo.toml | 2 +- README.md | 40 ++++++++-------------------------------- src/app/mod.rs | 6 +++--- 4 files changed, 25 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad89c112857..3210eef7dac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ + +## v2.9.0 (2016-07-01) + + +#### Documentation + +* **Completions:** adds documentation for completion scripts ([c6c519e4](https://github.com/kbknapp/clap-rs/commit/c6c519e40efd6c4533a9ef5efe8e74fd150391b7)) + +#### Features + +* **Completions:** one can now generate a bash completions script at compile time! ([e75b6c7b](https://github.com/kbknapp/clap-rs/commit/e75b6c7b75f729afb9eb1d2a2faf61dca7674634), closes [#376](https://github.com/kbknapp/clap-rs/issues/376)) + + ## v2.8.0 (2016-06-30) diff --git a/Cargo.toml b/Cargo.toml index e1a0b980fa3..f0256a035e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap" -version = "2.8.0" +version = "2.9.0" authors = ["Kevin K. "] exclude = ["examples/*", "clap-test/*", "tests/*", "benches/*", "*.png", "clap-perf/*", "*.dot"] description = "A simple to use, efficient, and full featured Command Line Argument Parser" diff --git a/README.md b/README.md index c923fe316c4..4bca128b628 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# clap +clap +==== [![Crates.io](https://img.shields.io/crates/v/clap.svg)](https://crates.io/crates/clap) [![Crates.io](https://img.shields.io/crates/d/clap.svg)](https://crates.io/crates/clap) [![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kbknapp/clap-rs/blob/master/LICENSE-MIT) [![Coverage Status](https://coveralls.io/repos/kbknapp/clap-rs/badge.svg?branch=master&service=github)](https://coveralls.io/github/kbknapp/clap-rs?branch=master) [![Join the chat at https://gitter.im/kbknapp/clap-rs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kbknapp/clap-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) @@ -38,6 +39,10 @@ Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc) ## What's New +Here's the highlights for v2.9.0 + +* **Completions:** one can now generate a bash completions script at compile time! + Here's the highlights for v2.8.0 * **Arg:** adds new optional setting `Arg::require_delimiter` which requires val delimiter to parse multiple values @@ -192,6 +197,8 @@ Below are a few of the features which `clap` supports, full descriptions and usa * **Auto-generated Help, Version, and Usage information** - Can optionally be fully, or partially overridden if you want a custom help, version, or usage +* **Auto-generated bash completion scripts at compile time** + - Even works through many multiple levels of subcommands * **Flags / Switches** (i.e. bool fields) - Both short and long versions supported (i.e. `-f` and `--flag` respectively) - Supports combining short versions (i.e. `-fBgoZ` is the same as `-f -B -g -o -Z`) @@ -340,37 +347,6 @@ fn main() { } ``` -The following combines the previous two examples by using the less verbose `from_usage` methods and the performance of the Builder Pattern. - -```rust -// (Full example with detailed comments in examples/01c_quick_example.rs) -// Must be compiled with `--features unstable` -// -// This example demonstrates clap's "usage strings" method of creating arguments which is less -// less verbose -#[macro_use] -extern crate clap; - -fn main() { - let matches = clap_app!(myapp => - (version: "1.0") - (author: "Kevin K. ") - (about: "Does awesome things") - (@arg config: -c --config +takes_value "Sets a custom config file") - (@arg INPUT: +required "Sets the input file to use") - (@arg verbose: -v ... "Sets the level of verbosity") - (@subcommand test => - (about: "controls testing features") - (version: "1.3") - (author: "Someone E. ") - (@arg verbose: -d --debug "Print debug information") - ) - ).get_matches(); - -// Same as previous examples... -} -``` - This final method shows how you can use a YAML file to build your CLI and keep your Rust source tidy or support multiple localized translations by having different YAML files for each localization. First, create the `cli.yml` file to hold your CLI options, but it could be called anything we like (we'll use the same both examples above to keep it functionally equivalent): ```yaml diff --git a/src/app/mod.rs b/src/app/mod.rs index e4e278d394a..e70d780775b 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -955,7 +955,7 @@ impl<'a, 'b> App<'a, 'b> { /// First, it helps if we separate out our `App` definition into a seperate file. Whether you /// do this as a function, or bare App definition is a matter of personal preference. /// - /// ```no_run + /// ```ignore /// // src/cli.rs /// /// use clap::{App, Arg, SubCommand}; @@ -977,7 +977,7 @@ impl<'a, 'b> App<'a, 'b> { /// In our regular code, we can simply call this `build_cli()` function, then call /// `get_mathces()`, or any of the other normal methods directly after. For example: /// - /// ```no_run + /// ```ignore /// src/main.rs /// /// use cli; @@ -999,7 +999,7 @@ impl<'a, 'b> App<'a, 'b> { /// /// Next, we place a `build.rs` in our project root. /// - /// ```no_run + /// ```ignore /// extern crate clap; /// /// use clap::Shell;