summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock341
-rw-r--r--Cargo.toml3
-rw-r--r--src/main.rs171
-rw-r--r--src/tui.rs94
4 files changed, 444 insertions, 165 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 62482da..1460eb4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -7,6 +7,14 @@ dependencies = [
]
[[package]]
+name = "aho-corasick"
+version = "0.6.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "ansi_term"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -16,7 +24,7 @@ dependencies = [
[[package]]
name = "atty"
-version = "0.2.10"
+version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -35,12 +43,17 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
+name = "cfg-if"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "clap"
version = "2.31.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -49,6 +62,41 @@ dependencies = [
]
[[package]]
+name = "clicolors-control"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "cloudabi"
+version = "0.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "console"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clicolors-control 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "crossbeam"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -73,6 +121,18 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
+name = "indicatif"
+version = "0.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "console 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "isatty"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -97,11 +157,25 @@ version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
+name = "lazy_static"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "libc"
version = "0.2.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
+name = "lock_api"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "memchr"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -110,6 +184,16 @@ dependencies = [
]
[[package]]
+name = "memchr"
+version = "2.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "mktemp"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -118,15 +202,45 @@ dependencies = [
]
[[package]]
-name = "pbr"
-version = "1.0.1"
+name = "num-traits"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "number_prefix"
+version = "0.2.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "owning_ref"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "parking_lot"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
- "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -164,6 +278,71 @@ dependencies = [
]
[[package]]
+name = "rand"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "rand_hc"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "rand_isaac"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "rand_pcg"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "rand_xorshift"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "redox_syscall"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -189,24 +368,43 @@ dependencies = [
]
[[package]]
+name = "regex"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "regex-syntax"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
+name = "regex-syntax"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "rsyarn"
version = "0.1.0"
dependencies = [
"clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "indicatif 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
"isatty 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"mktemp 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "pbr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
"quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
- "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -215,6 +413,45 @@ version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
+name = "rustc_version"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "scopeguard"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "semver"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "semver-parser"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "smallvec"
+version = "0.6.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "stable_deref_trait"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "strsim"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -230,6 +467,14 @@ dependencies = [
]
[[package]]
+name = "termios"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "textwrap"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -255,26 +500,42 @@ dependencies = [
]
[[package]]
-name = "time"
-version = "0.1.40"
+name = "thread_local"
+version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
+name = "ucd-util"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "unicode-width"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
+name = "unreachable"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "utf8-ranges"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
+name = "utf8-ranges"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "uuid"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -289,6 +550,16 @@ version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
+name = "version_check"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "void"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -319,41 +590,75 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66"
+"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
-"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1"
+"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789"
+"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
"checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536"
+"checksum clicolors-control 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "51872be694bb3bcbd1ea95c6dd467c2c46c6c64d287e1c9084ace7c3116ae9c0"
+"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
+"checksum console 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ba5561f4d4d89e0f246d4dd83846d96f617e886b96c7aee36e68791c98f89ce"
"checksum crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be"
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
"checksum getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05"
+"checksum indicatif 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4fb831cf2537b05b856bab08c5c91c473821c4bb5fc1ec7749c227e2005ef121"
"checksum isatty 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6c324313540cd4d7ba008d43dc6606a32a5579f13cc17b2804c13096f0a5c522"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
+"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1"
+"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c"
"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"
+"checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16"
"checksum mktemp 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77001ceb9eed65439f3dc2a2543f9ba1417d912686bf224a7738d0966e6dcd69"
-"checksum pbr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "deb73390ab68d81992bd994d145f697451bb0b54fd39738e72eef32458ad6907"
+"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1"
+"checksum number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbf9993e59c894e3c08aa1c2712914e9e6bf1fcbfc6bef283e2183df345a4fee"
+"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13"
+"checksum parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9723236a9525c757d9725b993511e3fc941e33f27751942232f0058298297edf"
+"checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9"
"checksum pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "378e941dbd392c101f2cb88097fa4d7167bc421d4b88de3ff7dbee503bc3233b"
"checksum quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0aad603e8d7fb67da22dbdf1f4b826ce8829e406124109e73cf1b2454b93a71c"
"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1"
"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5"
+"checksum rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9d223d52ae411a33cf7e54ec6034ec165df296ccd23533d671a28252b6f66a"
+"checksum rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "771b009e3a508cb67e8823dda454aaa5368c7bc1c16829fb77d3e980440dd34a"
+"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
+"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
+"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
+"checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05"
+"checksum rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effa3fcaa47e18db002bdde6060944b6d2f9cfd8db471c30e873448ad9187be3"
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
+"checksum regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37e7cbbd370869ce2e8dff25c7018702d10b21a20ef7135316f8daecd6c25b7f"
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
+"checksum regex-syntax 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4e47a2ed29da7a9e1960e1639e7a982e6edc6d49be308a3b02daf511504a16d1"
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
+"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
+"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
+"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
+"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
+"checksum smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b73ea3738b47563803ef814925e69be00799a8c07420be8b996f8e98fb2336db"
+"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
+"checksum termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625"
"checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
-"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b"
+"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
+"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86"
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
+"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f"
+"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"
"checksum uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "78c590b5bd79ed10aad8fb75f078a59d8db445af6c743e55c4a53227fc01c13f"
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
+"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
+"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
diff --git a/Cargo.toml b/Cargo.toml
index 3729494..8b0fcf4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,11 +6,10 @@ authors = ["Daniel Silverstone <dsilvers@digital-scurf.org>"]
[dependencies]
pulldown-cmark = "~0.0.8"
clap = "~2"
-pbr = "~1"
+indicatif = "0.10"
lazy_static = "~0.2.2"
regex = "~0.1.80"
isatty = "~0.1.1"
quick-error = "~1.1.0"
mktemp = "~0.3.1"
-termion = "~1"
crossbeam = "~0.2.10"
diff --git a/src/main.rs b/src/main.rs
index a7510a8..5ef020b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,21 +5,19 @@ extern crate lazy_static;
#[macro_use]
extern crate quick_error;
-extern crate pbr;
+extern crate indicatif;
-extern crate regex;
extern crate pulldown_cmark;
+extern crate regex;
extern crate mktemp;
-extern crate termion;
-
extern crate crossbeam;
+use std::fs;
use std::io;
use std::io::Write;
use std::process::exit;
-use std::fs;
use std::time::Instant;
use std::sync::mpsc::channel;
@@ -28,11 +26,11 @@ use std::sync::{Arc, Mutex};
use regex::Regex;
mod cli;
-mod opt;
mod err;
-mod yarn;
+mod opt;
mod runner;
mod tui;
+mod yarn;
#[derive(Debug, PartialEq, Eq)]
enum RunResult {
@@ -41,14 +39,15 @@ enum RunResult {
Failed,
}
-fn run_scenario<'a>(args: &opt::YarnArgs,
- yf: &'a yarn::YarnFiles,
- scenario: &'a yarn::YarnScenario,
- yarnfile: &'a yarn::YarnFile,
- joiner: &tui::TextUi,
- row: usize,
- timings: &mut Vec<String>)
- -> RunResult {
+fn run_scenario<'a>(
+ args: &opt::YarnArgs,
+ yf: &'a yarn::YarnFiles,
+ scenario: &'a yarn::YarnScenario,
+ yarnfile: &'a yarn::YarnFile,
+ joiner: &tui::TextUi,
+ row: usize,
+ timings: &mut Vec<String>,
+) -> RunResult {
joiner.reset_bar(row, scenario.lines.len() as u64);
let scenstart = Instant::now();
let mut runner = runner::YarnRunner::new(&args);
@@ -61,21 +60,32 @@ fn run_scenario<'a>(args: &opt::YarnArgs,
let steps: Vec<&yarn::YarnScenarioLine> = runner.run(&scenario, &yarnfile, &yf).clone();
let mut idx: usize = 0;
for step in steps {
- joiner.bar_message(row,
- format!("[{:30.30}] ",
- format!("{} {}", step.cmd.as_str(), step.text)));
+ joiner.bar_message(
+ row,
+ format!(
+ "[{:30.30}] ",
+ format!("{} {}", step.cmd.as_str(), step.text)
+ ),
+ );
if args.verbose {
- joiner.msg(&format!("Running step '{} {}' for {}",
- step.cmd.as_str(),
- step.text,
- scenario.name));
+ joiner.msg(&format!(
+ "Running step '{} {}' for {}",
+ step.cmd.as_str(),
+ step.text,
+ scenario.name
+ ));
}
let stepstart = Instant::now();
runner.run_step(idx, step, &joiner);
let stepend = stepstart.elapsed();
- let runtime: f64 = (stepend.as_secs() as f64) +
- ((stepend.subsec_nanos() as f64) / 1000000000.0);
- timings.push(format!(" {:2.3} {} {}", runtime, step.cmd.as_str(), step.text));
+ let runtime: f64 =
+ (stepend.as_secs() as f64) + ((stepend.subsec_nanos() as f64) / 1000000000.0);
+ timings.push(format!(
+ " {:2.3} {} {}",
+ runtime,
+ step.cmd.as_str(),
+ step.text
+ ));
joiner.bar_inc(row);
joiner.scen_inc();
idx += 1;
@@ -97,8 +107,8 @@ fn run_scenario<'a>(args: &opt::YarnArgs,
joiner.msg(&format!("Finished Scenario {}", scenario.name));
}
let scenend = scenstart.elapsed();
- let runtime: f64 = (scenend.as_secs() as f64) +
- ((scenend.subsec_nanos() as f64) / 1000000000.0);
+ let runtime: f64 =
+ (scenend.as_secs() as f64) + ((scenend.subsec_nanos() as f64) / 1000000000.0);
timings.insert(0, format!("{:2.3} {}", runtime, scenario.name));
ret
}
@@ -126,9 +136,10 @@ fn run_yarn(args: &opt::YarnArgs) -> err::YarnResult<()> {
}
if !args.quiet {
- println!("Parsed and linked {} scenario(s) totalling {} step(s)",
- scens,
- steps);
+ println!(
+ "Parsed and linked {} scenario(s) totalling {} step(s)",
+ scens, steps
+ );
}
let mut tui = tui::TextUiBuilder::new(steps as u64);
@@ -145,11 +156,11 @@ fn run_yarn(args: &opt::YarnArgs) -> err::YarnResult<()> {
let (jobtx, jobrx) = channel::<Option<YarnJob>>();
for &(ref scenario, ref yarnfile) in &yf.scenarios() {
- jobtx.send(Some(YarnJob {
+ jobtx
+ .send(Some(YarnJob {
scenario: scenario,
yarnfile: &yarnfile,
- }))
- .unwrap();
+ })).unwrap();
}
let jobrx = Arc::new(Mutex::new(jobrx));
@@ -166,35 +177,33 @@ fn run_yarn(args: &opt::YarnArgs) -> err::YarnResult<()> {
let joiner = joiner.clone();
let failing = failing.clone();
jobtx.send(None).unwrap();
- scope.spawn(move || {
- loop {
- let job = {
- let lock = workerjobrx.lock().unwrap();
- lock.recv()
- };
- if let Some(job) = job.unwrap() {
- let alreadyfailing: bool = {
- *failing.lock().unwrap()
- };
- if !(alreadyfailing && args.stop_on_fail) {
- let mut timings: Vec<String> = Vec::new();
- let rr = run_scenario(args,
- &yf,
- job.scenario,
- job.yarnfile,
- &joiner,
- worker,
- &mut timings);
- if rr == RunResult::Failed {
- *failing.lock().unwrap() = true;
- }
- workerrestx.send((job, rr, timings)).unwrap();
- } else {
- break;
+ scope.spawn(move || loop {
+ let job = {
+ let lock = workerjobrx.lock().unwrap();
+ lock.recv()
+ };
+ if let Some(job) = job.unwrap() {
+ let alreadyfailing: bool = { *failing.lock().unwrap() };
+ if !(alreadyfailing && args.stop_on_fail) {
+ let mut timings: Vec<String> = Vec::new();
+ let rr = run_scenario(
+ args,
+ &yf,
+ job.scenario,
+ job.yarnfile,
+ &joiner,
+ worker,
+ &mut timings,
+ );
+ if rr == RunResult::Failed {
+ *failing.lock().unwrap() = true;
}
+ workerrestx.send((job, rr, timings)).unwrap();
} else {
break;
}
+ } else {
+ break;
}
});
}
@@ -222,31 +231,45 @@ fn run_yarn(args: &opt::YarnArgs) -> err::YarnResult<()> {
if !args.quiet {
let runend = runstart.elapsed();
- let runtime: f64 = (runend.as_secs() as f64) +
- ((runend.subsec_nanos() as f64) / 1000000000.0);
- println!("Summary: {} failed, {} skipped, {} passed, in {:2.3} seconds",
- results.iter().filter(|&g| g.2 == RunResult::Failed).count(),
- results.iter().filter(|&g| g.2 == RunResult::Skipped).count(),
- results.iter().filter(|&g| g.2 == RunResult::Success).count(),
- runtime);
+ let runtime: f64 =
+ (runend.as_secs() as f64) + ((runend.subsec_nanos() as f64) / 1000000000.0);
+ println!(
+ "Summary: {} failed, {} skipped, {} passed, in {:2.3} seconds",
+ results.iter().filter(|&g| g.2 == RunResult::Failed).count(),
+ results
+ .iter()
+ .filter(|&g| g.2 == RunResult::Skipped)
+ .count(),
+ results
+ .iter()
+ .filter(|&g| g.2 == RunResult::Success)
+ .count(),
+ runtime
+ );
for &(ref scen, ref file, ref res) in &results {
match *res {
RunResult::Success => {
if args.verbose {
- println!(" PASS {} from {}",
- scen.name,
- file.source.format_location(scen.loc));
+ println!(
+ " PASS {} from {}",
+ scen.name,
+ file.source.format_location(scen.loc)
+ );
}
}
RunResult::Skipped => {
- println!(" SKIP {} from {}",
- scen.name,
- file.source.format_location(scen.loc));
+ println!(
+ " SKIP {} from {}",
+ scen.name,
+ file.source.format_location(scen.loc)
+ );
}
RunResult::Failed => {
- println!(" FAIL {} from {}",
- scen.name,
- file.source.format_location(scen.loc));
+ println!(
+ " FAIL {} from {}",
+ scen.name,
+ file.source.format_location(scen.loc)
+ );
}
};
}
diff --git a/src/tui.rs b/src/tui.rs
index 3272bad..61c9f12 100644
--- a/src/tui.rs
+++ b/src/tui.rs
@@ -1,26 +1,23 @@
-
-use std::io::{Result, Write};
-use pbr::{ProgressBar, MultiBar, Pipe};
-
+use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
use std::thread::{spawn, JoinHandle};
-use std::sync::mpsc::{channel, Sender, Receiver};
+use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::{Arc, Mutex};
-use termion;
-
pub struct TextUiBuilder {
- mb: MultiBar<TuiPipe>,
+ mb: MultiProgress,
chan: (Sender<TuiMsg>, Receiver<TuiMsg>),
- scenbar: ProgressBar<Pipe>,
- stepbars: Vec<ProgressBar<Pipe>>,
+ scenbar: ProgressBar,
+ stepbars: Vec<ProgressBar>,
}
impl TextUiBuilder {
pub fn new(scens: u64) -> TextUiBuilder {
let chan = channel();
- let mut mb = MultiBar::on(TuiPipe { chan: chan.0.clone() });
- let sb = mb.create_bar(scens);
+ let mb = MultiProgress::new();
+ let sb = ProgressBar::new(scens);
+ sb.set_style(ProgressStyle::default_bar().template("{spinner} {wide_bar} {pos}/{len}"));
+ let sb = mb.add(sb);
TextUiBuilder {
mb: mb,
chan: chan,
@@ -30,7 +27,11 @@ impl TextUiBuilder {
}
pub fn create_bar(&mut self, max: u64) {
- self.stepbars.push(self.mb.create_bar(max))
+ let bar = ProgressBar::new(max);
+ bar.set_style(
+ ProgressStyle::default_bar().template("{prefix} {spinner} {wide_bar} {pos}/{len}"),
+ );
+ self.stepbars.push(self.mb.add(bar))
}
pub fn begin_render(self, showbar: bool) -> TextUi {
@@ -45,70 +46,38 @@ impl TextUiBuilder {
let render_thread = {
let txc = msgtx.clone();
spawn(move || {
- mb.listen();
+ mb.join_and_clear().unwrap();
txc.lock().unwrap().send(TuiMsg::Finished).unwrap();
})
};
let tui_thread = spawn(move || {
- let mut mbar_showing = false;
- let mut first = true;
loop {
let msg = rx.recv().unwrap();
match msg {
TuiMsg::Finished => {
- // Erase all but the scenario bar
- if mbar_showing {
- print!("\r{}", termion::cursor::Up(lines - 1));
- for _ in 0..lines - 1 {
- println!("{}", termion::clear::AfterCursor);
- }
- print!("{}", termion::cursor::Up(lines - 1));
- }
break;
}
- TuiMsg::MultiBar(msg) => {
- if showbar {
- if !mbar_showing && !first {
- for _ in 0..lines {
- print!("\n");
- }
- }
- print!("{}", msg);
- mbar_showing = true;
- first = false;
- }
- }
TuiMsg::Message(msg) => {
- if mbar_showing {
- // Erase mbar somehow
- print!("\r{}", termion::cursor::Up(lines));
- for _ in 0..lines {
- println!("{}", termion::clear::AfterCursor);
- }
- print!("{}", termion::cursor::Up(lines));
- mbar_showing = false;
- }
- println!("{}", msg);
+ scenbar.println(msg);
}
TuiMsg::ResetBar(bar, max) => {
- stepbars[bar].total = max;
- stepbars[bar].set(0);
+ stepbars[bar].set_length(max);
+ stepbars[bar].set_position(0);
stepbars[bar].tick();
}
TuiMsg::BarMessage(bar, msg) => {
- stepbars[bar].message(&msg);
+ stepbars[bar].set_prefix(&msg);
}
TuiMsg::BarInc(bar) => {
- stepbars[bar].inc();
+ stepbars[bar].inc(1);
}
TuiMsg::ScenInc => {
- scenbar.inc();
+ scenbar.inc(1);
}
TuiMsg::FinishBars => {
scenbar.finish();
for i in 0..stepbars.len() {
- stepbars[i].message("Finished ");
- stepbars[i].tick();
+ stepbars[i].set_prefix("Finished");
stepbars[i].finish();
}
}
@@ -139,7 +108,7 @@ impl TextUi {
}
pub fn msg(&self, msg: &str) {
- self.send(TuiMsg::Message(msg.to_owned()));
+ self.send(TuiMsg::Message(format!("{}\n", msg)));
}
pub fn reset_bar(&self, bar: usize, max: u64) {
@@ -170,25 +139,8 @@ impl TextUi {
}
}
-pub struct TuiPipe {
- chan: Sender<TuiMsg>,
-}
-
-impl Write for TuiPipe {
- fn write(&mut self, buf: &[u8]) -> Result<usize> {
- let s = String::from_utf8_lossy(buf).to_mut().clone();
- self.chan.send(TuiMsg::MultiBar(s)).unwrap();
- Ok(1)
- }
-
- fn flush(&mut self) -> Result<()> {
- Ok(())
- }
-}
-
enum TuiMsg {
Finished,
- MultiBar(String),
Message(String),
ResetBar(usize, u64),
BarMessage(usize, String),