From fefce517d099526265a374246d45afe87bbdfc1b Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 15 Jul 2020 16:10:35 +0200 Subject: [PATCH] Wrap the help text to the terminal width --- tools/yabridgectl/Cargo.lock | 53 +++++++++++++++++++++++++++++++++--- tools/yabridgectl/Cargo.toml | 2 +- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/tools/yabridgectl/Cargo.lock b/tools/yabridgectl/Cargo.lock index 90a9ac07..8c91f2d0 100644 --- a/tools/yabridgectl/Cargo.lock +++ b/tools/yabridgectl/Cargo.lock @@ -17,7 +17,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -51,6 +51,7 @@ dependencies = [ "lazy_static", "os_str_bytes", "strsim", + "term_size 1.0.0-beta1", "termcolor", "textwrap", "unicode-width", @@ -78,7 +79,7 @@ checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" dependencies = [ "atty", "lazy_static", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -162,6 +163,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -340,6 +351,27 @@ dependencies = [ "syn", ] +[[package]] +name = "term_size" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "term_size" +version = "1.0.0-beta1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a17d8699e154863becdf18e4fd28bd0be27ca72856f54daf75c00f2566898f" +dependencies = [ + "kernel32-sys", + "libc", + "winapi 0.2.8", +] + [[package]] name = "termcolor" version = "1.1.0" @@ -355,6 +387,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ + "term_size 0.3.2", "unicode-width", ] @@ -404,10 +437,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ "same-file", - "winapi", + "winapi 0.3.9", "winapi-util", ] +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + [[package]] name = "winapi" version = "0.3.9" @@ -418,6 +457,12 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -430,7 +475,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi", + "winapi 0.3.9", ] [[package]] diff --git a/tools/yabridgectl/Cargo.toml b/tools/yabridgectl/Cargo.toml index cf7aa630..d3d7f579 100644 --- a/tools/yabridgectl/Cargo.toml +++ b/tools/yabridgectl/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-or-later" [dependencies] aho-corasick = "0.7.13" colored = "2.0.0" -clap = "3.0.0-beta.1" +clap = { version = "3.0.0-beta.1", features = ["wrap_help"] } lazy_static = "1.4.0" rayon = "1.3.1" serde = "1.0.114"