From e021c67867971cb15b8440969398bf72d88de29f Mon Sep 17 00:00:00 2001 From: Sune Kirkeby Date: Fri, 19 Jan 2018 10:43:09 +0100 Subject: [PATCH 1/2] Allow opting out of clap default features. Clap comes with some colorful default features, which are not always useful or wanted, so allow opting out of them. --- Cargo.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eadd04b9..86fb3cfd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structopt" -version = "0.1.6" +version = "0.1.7" authors = ["Guillaume Pinot "] description = "Parse command line argument by defining a struct." documentation = "https://docs.rs/structopt" @@ -10,11 +10,14 @@ categories = ["command-line-interface"] license = "WTFPL" readme = "README.md" +[features] +default = ["clap/default"] + [badges] travis-ci = { repository = "TeXitoi/structopt" } [dependencies] -clap = "2.20" +clap = { version = "2.20", default-features = false } [dev-dependencies] structopt-derive = { path = "structopt-derive", version = "0.1.6" } From d2bb209383fe14f2985b7afdc06fcde8dcb8a66a Mon Sep 17 00:00:00 2001 From: Sune Kirkeby Date: Tue, 23 Jan 2018 12:15:17 +0100 Subject: [PATCH 2/2] Document how to disable clap default-features. --- src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 95d9d7e4..fdac1bf9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,6 +13,15 @@ //! little interest. See the //! [`structopt-derive`](https://docs.rs/structopt-derive) crate to //! automatically generate an implementation of this trait. +//! +//! If you want to disable all the `clap` features (colors, +//! suggestions, ..) add `default-features = false` to the `structopt` +//! dependency: +//! ```toml +//! [dependencies] +//! structopt = { version = "0.1.0", default-features = false } +//! structopt-derive = "0.1.0" +//! ``` extern crate clap as _clap;