2015-02-25 13:37:25 +00:00
|
|
|
[package]
|
|
|
|
|
|
|
|
name = "clap"
|
2017-07-21 13:58:40 +00:00
|
|
|
version = "2.25.1"
|
2015-02-25 13:37:25 +00:00
|
|
|
authors = ["Kevin K. <kbknapp@gmail.com>"]
|
2016-05-10 00:27:10 +00:00
|
|
|
exclude = ["examples/*", "clap-test/*", "tests/*", "benches/*", "*.png", "clap-perf/*", "*.dot"]
|
2015-03-01 00:56:43 +00:00
|
|
|
repository = "https://github.com/kbknapp/clap-rs.git"
|
2016-08-27 15:08:51 +00:00
|
|
|
documentation = "https://docs.rs/clap/"
|
2016-09-18 19:52:50 +00:00
|
|
|
homepage = "https://clap.rs/"
|
2015-03-01 00:56:43 +00:00
|
|
|
readme = "README.md"
|
2015-05-17 22:26:03 +00:00
|
|
|
license = "MIT"
|
2015-03-04 13:32:55 +00:00
|
|
|
keywords = ["argument", "command", "arg", "parser", "parse"]
|
2017-02-16 14:44:44 +00:00
|
|
|
categories = ["command-line-interface"]
|
2016-08-27 15:08:51 +00:00
|
|
|
description = """
|
|
|
|
A simple to use, efficient, and full featured Command Line Argument Parser
|
|
|
|
"""
|
2015-03-01 00:56:43 +00:00
|
|
|
|
2017-07-21 13:55:27 +00:00
|
|
|
[badges]
|
|
|
|
travis-ci = { repository = "kbknapp/clap-rs" }
|
|
|
|
appveyor = { repository = "kbknapp/clap-rs" }
|
|
|
|
|
2015-09-30 21:14:48 +00:00
|
|
|
[dependencies]
|
2017-05-22 09:33:38 +00:00
|
|
|
bitflags = "0.9"
|
2017-05-10 12:25:30 +00:00
|
|
|
vec_map = "0.8"
|
2017-01-30 02:14:46 +00:00
|
|
|
unicode-width = "0.1.4"
|
2017-05-23 06:59:23 +00:00
|
|
|
unicode-segmentation = "~1.1.0" # 1.2.0 requires Rust 1.13.0
|
feat: use textwrap crate for wrapping help texts
The textwrap crate uses a simpler linear-time algorithm for wrapping
the text. The current algorithm in wrap_help uses several O(n) calls
to String::insert and String::remove, which makes it potentially
quadratic in complexity.
Comparing the 05_ripgrep benchmark at commits textwrap~2 and textwrap
gives this result on my machine:
name before ns/iter after ns/iter diff ns/iter diff %
build_app_long 22,101 21,099 -1,002 -4.53%
build_app_short 22,138 21,205 -933 -4.21%
build_help_long 514,265 284,467 -229,798 -44.68%
build_help_short 85,720 85,693 -27 -0.03%
parse_clean 23,471 22,859 -612 -2.61%
parse_complex 29,535 28,919 -616 -2.09%
parse_lots 422,815 414,577 -8,238 -1.95%
As part of this commit, the wrapping_newline_chars test was updated.
The old algorithm had a subtle bug where it would break lines too
early. That is, it wrapped the text like
ARGS:
<mode> x, max, maximum 20 characters, contains
symbols.
l, long Copy-friendly,
14 characters, contains symbols.
m, med, medium Copy-friendly, 8
characters, contains symbols.";
when it should really have wrapped it like
ARGS:
<mode> x, max, maximum 20 characters, contains
symbols.
l, long Copy-friendly, 14
characters, contains symbols.
m, med, medium Copy-friendly, 8
characters, contains symbols.";
Notice how the word "14" was incorrectly moved to the next line. There
is clearly room for the word on the line with the "l, long" option
since there is room for "contains" just above it.
I'm not sure why this is, but the algorithm in textwrap handles this
case correctly.
2017-01-28 11:42:09 +00:00
|
|
|
textwrap = "0.6.0"
|
2017-01-30 02:14:46 +00:00
|
|
|
strsim = { version = "0.6.0", optional = true }
|
|
|
|
ansi_term = { version = "0.9.0", optional = true }
|
2017-04-09 18:39:38 +00:00
|
|
|
term_size = { version = "0.3.0", optional = true }
|
2017-01-30 02:14:46 +00:00
|
|
|
yaml-rust = { version = "0.3.5", optional = true }
|
2017-05-10 12:25:30 +00:00
|
|
|
clippy = { version = "~0.0.131", optional = true }
|
2017-02-19 16:12:55 +00:00
|
|
|
atty = { version = "0.2.2", optional = true }
|
2015-08-25 21:28:38 +00:00
|
|
|
|
2016-05-09 01:33:56 +00:00
|
|
|
[dev-dependencies]
|
2017-02-28 04:49:51 +00:00
|
|
|
regex = "0.2"
|
|
|
|
lazy_static = "0.2"
|
2016-05-09 01:33:56 +00:00
|
|
|
|
2015-08-25 21:28:38 +00:00
|
|
|
[features]
|
2016-03-12 20:47:57 +00:00
|
|
|
default = ["suggestions", "color", "wrap_help"]
|
2015-10-19 12:00:13 +00:00
|
|
|
suggestions = ["strsim"]
|
2017-02-19 16:12:55 +00:00
|
|
|
color = ["ansi_term", "atty"]
|
2017-03-05 18:44:16 +00:00
|
|
|
wrap_help = ["term_size"]
|
2016-10-15 02:58:36 +00:00
|
|
|
yaml = ["yaml-rust"]
|
2016-10-15 21:37:59 +00:00
|
|
|
unstable = [] # for building with unstable clap features (doesn't require nightly Rust) (currently none)
|
2016-10-15 02:58:36 +00:00
|
|
|
nightly = [] # for building with unstable Rust features (currently none)
|
2016-10-15 17:08:51 +00:00
|
|
|
lints = ["clippy"] # Requires nightly Rust
|
2016-10-15 02:58:36 +00:00
|
|
|
debug = [] # Enables debug messages
|
2016-12-28 02:07:59 +00:00
|
|
|
no_cargo = [] # Enable if you're not using Cargo, disables Cargo-env-var-dependent macros
|
2017-07-07 11:11:34 +00:00
|
|
|
doc = ["yaml"] # All the features which add to documentation
|
2016-01-26 04:09:34 +00:00
|
|
|
|
|
|
|
[profile.release]
|
|
|
|
opt-level = 3
|
|
|
|
debug = false
|
|
|
|
rpath = false
|
|
|
|
lto = true
|
|
|
|
debug-assertions = false
|
|
|
|
# codegen-units ignored with lto=true
|
|
|
|
|
|
|
|
[profile.dev]
|
|
|
|
opt-level = 0
|
|
|
|
debug = true
|
|
|
|
rpath = false
|
|
|
|
lto = false
|
|
|
|
debug-assertions = true
|
|
|
|
codegen-units = 4
|
|
|
|
|
|
|
|
[profile.test]
|
|
|
|
opt-level = 1
|
|
|
|
debug = true
|
|
|
|
rpath = false
|
|
|
|
lto = false
|
|
|
|
debug-assertions = true
|
2017-03-11 05:18:13 +00:00
|
|
|
codegen-units = 4
|
2016-01-26 04:09:34 +00:00
|
|
|
|
|
|
|
[profile.bench]
|
|
|
|
opt-level = 3
|
|
|
|
debug = false
|
|
|
|
rpath = false
|
|
|
|
lto = true
|
|
|
|
debug-assertions = false
|
|
|
|
|
|
|
|
[profile.doc]
|
|
|
|
opt-level = 0
|
|
|
|
debug = true
|
|
|
|
rpath = false
|
|
|
|
lto = false
|
|
|
|
debug-assertions = true
|
|
|
|
codegen-units = 4
|
2017-07-07 11:11:34 +00:00
|
|
|
|
|
|
|
[package.metadata.docs.rs]
|
|
|
|
features = ["doc"]
|