From 261d7a793f98aa368f4cd4dbcb2dc790220f150b Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Wed, 22 May 2019 00:12:03 -0700 Subject: [PATCH] Restructure and make commands uniform --- Cargo.lock | 490 +++++++++++++++++++++++++++++++------ Cargo.toml | 7 +- src/commands.rs | 3 +- src/commands/cd.rs | 30 +-- src/commands/classified.rs | 55 +++++ src/commands/command.rs | 32 ++- src/commands/ls.rs | 25 +- src/commands/ps.rs | 24 +- src/commands/reject.rs | 38 ++- src/commands/select.rs | 38 ++- src/commands/skip.rs | 36 ++- src/commands/sort_by.rs | 36 ++- src/commands/take.rs | 34 ++- src/commands/to_array.rs | 14 +- src/commands/view.rs | 38 ++- src/commands/where_.rs | 46 ++-- src/context.rs | 25 +- src/format.rs | 9 +- src/main.rs | 152 ++++++------ src/object/base.rs | 56 +++-- src/parser/completer.rs | 2 +- src/prelude.rs | 2 +- 22 files changed, 776 insertions(+), 416 deletions(-) create mode 100644 src/commands/classified.rs diff --git a/Cargo.lock b/Cargo.lock index d8806fecd8..d7a304c059 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,7 +18,7 @@ name = "ansi_colours" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -29,6 +29,11 @@ dependencies = [ "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "arc-swap" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "argon2rs" version = "0.2.5" @@ -38,6 +43,11 @@ dependencies = [ "scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "array-macro" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "arrayvec" version = "0.4.10" @@ -51,7 +61,7 @@ name = "atty" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -63,15 +73,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "backtrace" -version = "0.3.15" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -79,8 +88,8 @@ name = "backtrace-sys" version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -136,12 +145,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cc" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cfg-if" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -149,8 +158,8 @@ name = "chrono" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -192,7 +201,7 @@ 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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -206,7 +215,7 @@ dependencies = [ [[package]] name = "conch-parser" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -221,7 +230,7 @@ dependencies = [ "clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "encode_unicode 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -255,7 +264,16 @@ name = "crc32fast" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-channel" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -273,7 +291,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -286,7 +304,7 @@ name = "crossbeam-utils" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -294,6 +312,15 @@ name = "crossbeam-utils" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "crossbeam-utils" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "csv" version = "1.0.7" @@ -313,6 +340,32 @@ dependencies = [ "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "cursive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "enum-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "enumset 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hashbrown 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pancurses 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", + "signal-hook 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "darling" version = "0.8.6" @@ -322,6 +375,15 @@ dependencies = [ "darling_macro 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "darling" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "darling_macro 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "darling_core" version = "0.8.6" @@ -334,6 +396,19 @@ dependencies = [ "syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "darling_core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "darling_macro" version = "0.8.6" @@ -344,6 +419,16 @@ dependencies = [ "syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "darling_macro" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "derive-new" version = "0.5.6" @@ -382,7 +467,7 @@ name = "directories" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -391,7 +476,7 @@ name = "dirs" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "redox_users 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -468,12 +553,59 @@ name = "encoding_index_tests" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "enum-map" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "enum-map-derive 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "enum-map-internals 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "enum-map-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "enum-map-internals" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "array-macro 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "enumset" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "enumset_derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "enumset_derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "error-chain" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -482,7 +614,7 @@ name = "failure" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -494,7 +626,7 @@ dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -503,7 +635,7 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "miniz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "miniz_oxide_c_api 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -531,6 +663,11 @@ dependencies = [ "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hashbrown" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "humantime" version = "1.2.0" @@ -562,6 +699,15 @@ name = "itoa" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "lazy_static" version = "1.3.0" @@ -577,7 +723,7 @@ name = "lexical-core" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "stackvector 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -585,7 +731,7 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.54" +version = "0.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -614,15 +760,20 @@ name = "log" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "maplit" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "memchr" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -635,8 +786,8 @@ name = "miniz-sys" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -652,21 +803,31 @@ name = "miniz_oxide_c_api" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", "crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "miniz_oxide 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ncurses" +version = "5.99.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "nix" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -694,7 +855,8 @@ dependencies = [ "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "chrono-humanize 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "chrono-tz 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "conch-parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "conch-parser 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cursive 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "dunce 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -707,28 +869,71 @@ dependencies = [ "prettytable-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustyline 4.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "subprocess 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "sysinfo 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sysinfo 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-complex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "num-iter 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", + "num-rational 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-complex" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-integer" -version = "0.1.39" +version = "0.1.40" 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)", + "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-iter" +version = "0.1.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-rational" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "num_cpus" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -743,7 +948,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "onig_sys 69.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -752,7 +957,7 @@ name = "onig_sys" version = "69.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -761,7 +966,27 @@ name = "ordered-float" version = "1.0.2" 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)", + "num-traits 0.2.7 (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 = "pancurses" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ncurses 5.99.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pdcurses-sys 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winreg 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -779,9 +1004,9 @@ name = "parking_lot_core" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -797,6 +1022,15 @@ dependencies = [ "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "pdcurses-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pkg-config" version = "0.3.14" @@ -875,7 +1109,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -930,7 +1164,7 @@ name = "rand_jitter" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -942,7 +1176,7 @@ 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-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -982,7 +1216,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1057,11 +1291,11 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "nix 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1143,11 +1377,34 @@ name = "shell-words" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "signal-hook" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "signal-hook-registry 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "signal-hook-registry" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arc-swap 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "smallvec" version = "0.6.9" source = "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 = "stackvector" version = "1.0.2" @@ -1161,6 +1418,11 @@ name = "static_assertions" version = "0.2.5" 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" + [[package]] name = "strsim" version = "0.8.0" @@ -1172,10 +1434,20 @@ version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "syn" +version = "0.14.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syn" version = "0.15.34" @@ -1188,7 +1460,7 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1220,11 +1492,11 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1239,12 +1511,22 @@ dependencies = [ "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "term_size" +version = "0.3.1" +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.55 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "termion" version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1255,7 +1537,7 @@ name = "termios" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1279,11 +1561,19 @@ name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "toml" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.91 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ucd-util" version = "0.1.3" @@ -1291,7 +1581,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-segmentation" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1347,6 +1637,11 @@ dependencies = [ "winapi-util 0.1.2 (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" + [[package]] name = "winapi" version = "0.3.7" @@ -1356,6 +1651,11 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -1374,6 +1674,19 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "winreg" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "xi-unicode" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "xml-rs" version = "0.8.0" @@ -1392,11 +1705,13 @@ dependencies = [ "checksum aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e6f484ae0c99fec2e858eb6134949117399f222608d84cadb3f58c1f97c2364c" "checksum ansi_colours 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d0f302a81afc6a7f4350c04f0ba7cfab529cc009bca3324b3fb5764e6add8b6" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum arc-swap 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "bc4662175ead9cd84451d5c35070517777949a2ed84551764129cedb88384841" "checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392" +"checksum array-macro 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7c4ff37a25fb442a1fecfd399be0dde685558bca30fb998420532889a36852d2" "checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" "checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799" -"checksum backtrace 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "f106c02a3604afcdc0df5d36cc47b44b55917dbaf3d808f71c163a0ddba64637" +"checksum backtrace 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)" = "45934a579eff9fd0ff637ac376a4bd134f47f8fc603f0b211d696b54d61e35f1" "checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" "checksum bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9f04a5e50dc80b3d5d35320889053637d15011aed5e66b66b37ae798c65da6f7" @@ -1405,29 +1720,35 @@ dependencies = [ "checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39" "checksum byte-unit 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6754bb4703aa167bed5381f0c6842f1cc31a9ecde3b9443f726dde3ad3afb841" "checksum byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a019b10a2a7cdeb292db131fc8113e57ea2a908f6e7894b0c3c671893b65dbeb" -"checksum cc 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)" = "a0c56216487bb80eec9c4516337b2588a4f2a2290d72a1416d930e4dcdb0c90d" -"checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4" +"checksum cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)" = "39f75544d7bbaf57560d2168f28fd649ff9c76153874db88bdbdfd839b1a7e7d" +"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" "checksum chrono-humanize 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2ff48a655fe8d2dae9a39e66af7fd8ff32a879e8c4e27422c25596a8b5e90d" "checksum chrono-tz 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e0e430fad0384e4defc3dc6b1223d1b886087a8bf9b7080e5ae027f73851ea15" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "73abfd4c73d003a674ce5d2933fca6ce6c42480ea84a5ffe0a2dc39ed56300f9" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum conch-parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2a6a607cf95979f2126c094f2ce279fbc8c58b7649d3b4a25905950931eba3c9" +"checksum conch-parser 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "baf61cea7edff80a7d8a9a4c219d391664715559e9d4e7129494b45278705a41" "checksum console 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2bf3720d3f3fc30b721ef1ae54e13af3264af4af39dc476a8de56a6ee1e2184b" "checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" "checksum content_inspector 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38" "checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +"checksum crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0f0ed1a4de2235cabda8558ff5840bffb97fcb64c97827f354a451307df5f72b" "checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" "checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150" "checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" "checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015" +"checksum crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f8306fcef4a7b563b76b7dd949ca48f52bc1141aa067d2ea09565f3e2652aa5c" "checksum csv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9044e25afb0924b5a5fc5511689b0918629e85d68ea591e5e87fbf1e85ea1b3b" "checksum csv-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5cdef62f37e6ffe7d1f07a381bc0db32b7a3ff1cac0de56cb0d81e71f53d65" +"checksum cursive 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7ecc7282b5361471b607c26f44148205607e26d48a2fc65bd16e7619b1ebb78" "checksum darling 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9158d690bc62a3a57c3e45b85e4d50de2008b39345592c64efd79345c7e24be0" +"checksum darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fcfbcb0c5961907597a7d1148e3af036268f2b773886b8bb3eeb1e1281d3d3d6" "checksum darling_core 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d2a368589465391e127e10c9e3a08efc8df66fd49b87dc8524c764bbe7f2ef82" +"checksum darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6afc018370c3bff3eb51f89256a6bdb18b4fdcda72d577982a14954a7a0b402c" "checksum darling_macro 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "244e8987bd4e174385240cde20a3657f607fb0797563c28255c353b5819a07b1" +"checksum darling_macro 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c6d8dac1c6f1d29a41c4712b4400f878cb4fcc4c7628f298dd75038e024998d1" "checksum derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6ca414e896ae072546f4d789f452daaecf60ddee4c9df5dc6d5936d769e3d87c" "checksum derive_builder 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a0ca533e6abb78f9108585535ce2ae0b14c8b4504e138a9a28eaf8ba2b270c1d" "checksum derive_builder_core 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fb484fe06ba1dc5b82f88aff700191dfc127e02b06b35e302c169706168e2528" @@ -1443,6 +1764,11 @@ dependencies = [ "checksum encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" "checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" "checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" +"checksum enum-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ccd9b2d5e0eb5c2ff851791e2af90ab4531b1168cfc239d1c0bf467e60ba3c89" +"checksum enum-map-derive 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "153f6e8a8b2868e2fedf921b165f30229edcccb74d6a9bb1ccf0480ef61cd07e" +"checksum enum-map-internals 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "38b0bacf3ea7aba18ce84032efc3f0fa29f5c814048b742ab3e64d07d83ac3e8" +"checksum enumset 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac0a22e173f6570a7d69a2ab9e3fe79cf0dcdd0fdb162bfc932b97158f2b2a7" +"checksum enumset_derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "01d93b926a992a4a526c2a14e2faf734fdef5bf9d0a52ba69a2ca7d4494c284b" "checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" @@ -1451,37 +1777,48 @@ dependencies = [ "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)" = "a2037ec1c6c1c4f79557762eab1f7eae1f64f6cb418ace90fae88f0942b60139" "checksum futures-core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7455c91eb2eae38f33b013f77ebe766c75761af333efd9d550e154045c63e225" +"checksum hashbrown 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "570178d5e4952010d138b0f1d581271ff3a02406d990f887d1e87e3d6e43b0ac" "checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" "checksum ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" "checksum lexical-core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e82e023e062f1d25f807ad182008fba1b46538e999f908a08cc0c29e084462e" -"checksum libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)" = "c6785aa7dd976f5fbf3b71cfd9cd49d7f783c1ff565a858d71031c6c313aa5c6" +"checksum libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "42914d39aad277d9e176efbdad68acb1d5443ab65afe0e0e4f0d49352a950880" "checksum line-wrap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum lock_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed946d4529956a20f2d63ebe1b69996d5a2137c91913fe3ebbeff957f5bca7ff" "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" +"checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" "checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum miniz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9e3ae51cea1576ceba0dde3d484d30e6e5b86dee0b2d412fe3a16a15c98202" "checksum miniz_oxide 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c468f2369f07d651a5d0bb2c9079f8488a66d5466efe42d0c5c6466edcb7f71e" "checksum miniz_oxide_c_api 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7fe927a42e3807ef71defb191dc87d4e24479b221e67015fe38ae2b7b447bab" +"checksum ncurses 5.99.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15699bee2f37e9f8828c7b35b2bc70d13846db453f2d507713b758fabe536b82" "checksum nix 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46f0f3210768d796e8fa79ec70ee6af172dacbe7147f5e69be5240a47778302b" "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" "checksum nom 5.0.0-beta1 (registry+https://github.com/rust-lang/crates.io-index)" = "6527f311b2baba609e980e008460ab5ebff6d6da15213bb8eb193b7746eefa24" -"checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" -"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" +"checksum num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db" +"checksum num-complex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "107b9be86cd2481930688277b675b0114578227f034674726605b8a482d8baf8" +"checksum num-integer 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "8b8af8caa3184078cd419b430ff93684cb13937970fcb7639f728992f33ce674" +"checksum num-iter 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "50b7cf973f09f27829571927831972c92bfd29de7a5a0148380afd12acf6d124" +"checksum num-rational 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4e96f040177bb3da242b5b1ecf3f54b5d5af3efbbfb18608977a5d2767b22f10" +"checksum num-traits 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "d9c79c952a4a139f44a0fe205c4ee66ce239c0e6ce72cd935f5f7e2f717549dd" "checksum num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a23f0ed30a54abaa0c7e83b1d2d87ada7c3c23078d1d87815af3e3b6385fbba" "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" "checksum onig 4.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a646989adad8a19f49be2090374712931c3a59835cb5277b4530f48b417f26e7" "checksum onig_sys 69.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388410bf5fa341f10e58e6db3975f4bea1ac30247dd79d37a9e5ced3cb4cc3b0" "checksum ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" +"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" +"checksum pancurses 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d3058bc37c433096b2ac7afef1c5cdfae49ede0a4ffec3dfc1df1df0959d0ff0" "checksum parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa7767817701cce701d5585b9c4db3cdd02086398322c1d7e8bf5094a96a2ce7" "checksum parking_lot_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cb88cb1cb3790baa6776844f968fea3be44956cf184fa1be5a03341f5491278c" "checksum parse-zoneinfo 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "089a398ccdcdd77b8c38909d5a1e4b67da1bc4c9dbfe6d5b536c828eddb779e5" +"checksum pdcurses-sys 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "084dd22796ff60f1225d4eb6329f33afaf4c85419d51d440ab6b8c6f4529166b" "checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" "checksum plist 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f4739851c08dd9a62a78beff2edf1a438517268b2c563c42fc6d9d3139e42d2a" "checksum prettyprint 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2705417f8aa07cb6308db42e55623479c1c9667942a4d5e4174c684e5da5590d" @@ -1522,23 +1859,30 @@ dependencies = [ "checksum serde_derive 1.0.91 (registry+https://github.com/rust-lang/crates.io-index)" = "101b495b109a3e3ca8c4cbe44cf62391527cdfb6ba15821c5ce80bcd5ea23f9f" "checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d" "checksum shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39acde55a154c4cd3ae048ac78cc21c25f3a0145e44111b523279113dce0d94a" +"checksum signal-hook 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "72ab58f1fda436857e6337dcb6a5aaa34f16c5ddc87b3a8b6ef7a212f90b9c5a" +"checksum signal-hook-registry 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cded4ffa32146722ec54ab1f16320568465aa922aa9ab4708129599740da85d7" "checksum smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c4488ae950c49d403731982257768f48fada354a5203fe81f9bb6f43ca9002be" +"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum stackvector 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c049c77bf85fbc036484c97b008276d539d9ebff9dfbde37b632ebcd5b8746b6" "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" +"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum subprocess 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "28fc0f40f0c0da73339d347aa7d6d2b90341a95683a47722bc4eebed71ff3c00" +"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" "checksum syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)" = "a1393e4a97a19c01e900df2aec855a29f71cf02c402e2f443b8d2747c25c5dbe" -"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" +"checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum syntect 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e80b8831c5a543192ffc3727f01cf0e57579c6ac15558e3048bfb5708892167b" -"checksum sysinfo 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d88e417391431019773011a31a6c967538da388782b7711f2f6fafd9e601e55" +"checksum sysinfo 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "65f0e28a49b7bf142cee89befd7077b40627d7cc70aa8a8acfe03afc26016c33" "checksum term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" +"checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327" "checksum termion 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dde0593aeb8d47accea5392b39350015b5eccb12c0d98044d856983d89548dea" "checksum termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" +"checksum toml 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b8c96d7873fa7ef8bdeb3a9cda3ac48389b4154f32b9803b4bc26220b677b039" "checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" -"checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1" +"checksum unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1967f4cdfc355b37fd76d2a954fb2ed3871034eb4f26d60537d88795cfc332a9" "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" @@ -1548,9 +1892,13 @@ dependencies = [ "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 walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum winreg 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a27a759395c1195c4cc5cda607ef6f8f6498f64e78f7900f5de0a127a424704a" +"checksum xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12ea8eda4b1eb72f02d148402e23832d56a33f55d8c1b2d5bcdde91d79d47cb1" "checksum xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "541b12c998c5b56aa2b4e6f18f03664eef9a4fd0a246a55594efae6cc2d964b5" "checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" diff --git a/Cargo.toml b/Cargo.toml index 6876b1120e..be014c70dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,15 +9,15 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rustyline = "4.0.0" -sysinfo = "0.8.3" +rustyline = "4.1.0" +sysinfo = "0.8.4" chrono = "0.4.6" chrono-tz = "0.5.1" derive-new = "0.5.6" prettytable-rs = "0.8.0" itertools = "0.8.0" ansi_term = "0.11.0" -conch-parser = "0.1.0" +conch-parser = "0.1.1" nom = "5.0.0-beta1" subprocess = "0.1.18" dunce = "1.0.0" @@ -28,3 +28,4 @@ chrono-humanize = "0.0.11" byte-unit = "2.1.0" ordered-float = "1.0.2" prettyprint = "0.6.0" +cursive = { version = "0.12.0", features = ["pancurses-backend"], default-features = false } diff --git a/src/commands.rs b/src/commands.rs index 109f08be74..d7f5d02dcb 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,5 +1,6 @@ crate mod args; crate mod cd; +crate mod classified; crate mod command; crate mod ls; crate mod ps; @@ -12,4 +13,4 @@ crate mod to_array; crate mod view; crate mod where_; -crate use to_array::to_array; +crate use to_array::stream_to_array; diff --git a/src/commands/cd.rs b/src/commands/cd.rs index 78c9d053c7..a4f6523427 100644 --- a/src/commands/cd.rs +++ b/src/commands/cd.rs @@ -1,25 +1,19 @@ use crate::errors::ShellError; use crate::prelude::*; -use derive_new::new; use std::env; -#[derive(new)] -pub struct Cd; +pub fn cd(args: CommandArgs<'caller>) -> Result, ShellError> { + let target = match args.args.first() { + // TODO: This needs better infra + None => return Err(ShellError::string(format!("cd must take one arg"))), + Some(v) => v.as_string()?.clone(), + }; -impl crate::Command for Cd { - fn run(&self, args: CommandArgs<'caller>) -> Result, ShellError> { - let target = match args.args.first() { - // TODO: This needs better infra - None => return Err(ShellError::string(format!("cd must take one arg"))), - Some(v) => v.as_string()?.clone(), - }; + let cwd = args.env.cwd().to_path_buf(); - let cwd = args.env.cwd().to_path_buf(); - - let mut stream = VecDeque::new(); - let path = dunce::canonicalize(cwd.join(&target).as_path())?; - let _ = env::set_current_dir(&path); - stream.push_back(ReturnValue::change_cwd(path)); - Ok(stream) - } + let mut stream = VecDeque::new(); + let path = dunce::canonicalize(cwd.join(&target).as_path())?; + let _ = env::set_current_dir(&path); + stream.push_back(ReturnValue::change_cwd(path)); + Ok(stream) } diff --git a/src/commands/classified.rs b/src/commands/classified.rs new file mode 100644 index 0000000000..07cda3c179 --- /dev/null +++ b/src/commands/classified.rs @@ -0,0 +1,55 @@ +use crate::prelude::*; +use std::sync::Arc; +use subprocess::Exec; + +crate enum ClassifiedCommand { + Internal(InternalCommand), + External(ExternalCommand), +} + +impl ClassifiedCommand { + crate fn run( + self, + input: VecDeque, + context: &mut crate::Context, + ) -> Result, ShellError> { + match self { + ClassifiedCommand::Internal(internal) => { + let result = context.run_command(internal.command, internal.args, input)?; + + let mut next = VecDeque::new(); + + for v in result { + match v { + ReturnValue::Action(action) => match action { + crate::CommandAction::ChangeCwd(cwd) => context.env.cwd = cwd, + }, + + ReturnValue::Value(v) => next.push_back(v), + } + } + + Ok(next) + } + + ClassifiedCommand::External(external) => { + Exec::shell(&external.name) + .args(&external.args) + .cwd(context.env.cwd()) + .join() + .unwrap(); + Ok(VecDeque::new()) + } + } + } +} + +crate struct InternalCommand { + crate command: Arc, + crate args: Vec, +} + +crate struct ExternalCommand { + crate name: String, + crate args: Vec, +} diff --git a/src/commands/command.rs b/src/commands/command.rs index e3cff2f250..bba76df199 100644 --- a/src/commands/command.rs +++ b/src/commands/command.rs @@ -1,22 +1,29 @@ use crate::errors::ShellError; use crate::object::Value; use crate::prelude::*; +use crate::Context; use std::path::PathBuf; pub struct CommandArgs<'caller> { - pub host: &'caller dyn Host, + pub host: &'caller mut dyn Host, pub env: &'caller crate::Environment, pub args: Vec, pub input: VecDeque, } -pub trait CommandBlueprint { - fn create( - &self, - input: Vec, - host: &dyn crate::Host, - env: &mut crate::Environment, - ) -> Result, ShellError>; +impl CommandArgs<'caller> { + crate fn from_context( + ctx: &'caller mut Context, + args: Vec, + input: VecDeque, + ) -> CommandArgs<'caller> { + CommandArgs { + host: &mut ctx.host, + env: &ctx.env, + args, + input, + } + } } #[derive(Debug)] @@ -45,3 +52,12 @@ impl ReturnValue { pub trait Command { fn run(&self, args: CommandArgs<'caller>) -> Result, ShellError>; } + +impl Command for F +where + F: Fn(CommandArgs<'_>) -> Result, ShellError>, +{ + fn run(&self, args: CommandArgs<'caller>) -> Result, ShellError> { + self(args) + } +} diff --git a/src/commands/ls.rs b/src/commands/ls.rs index aec984a500..b591bdc02b 100644 --- a/src/commands/ls.rs +++ b/src/commands/ls.rs @@ -1,25 +1,18 @@ use crate::errors::ShellError; use crate::object::{dir_entry_dict, Value}; use crate::prelude::*; -use derive_new::new; -#[derive(new)] -pub struct Ls; +pub fn ls(args: CommandArgs<'value>) -> Result, ShellError> { + let cwd = args.env.cwd().to_path_buf(); -impl crate::Command for Ls { - fn run(&self, args: CommandArgs<'value>) -> Result, ShellError> { - let cwd = args.env.cwd().to_path_buf(); + let entries = std::fs::read_dir(&cwd).map_err(|e| ShellError::string(format!("{:?}", e)))?; - let entries = - std::fs::read_dir(&cwd).map_err(|e| ShellError::string(format!("{:?}", e)))?; + let mut shell_entries = VecDeque::new(); - let mut shell_entries = VecDeque::new(); - - for entry in entries { - let value = Value::Object(dir_entry_dict(&entry?)?); - shell_entries.push_back(ReturnValue::Value(value)) - } - - Ok(shell_entries) + for entry in entries { + let value = Value::Object(dir_entry_dict(&entry?)?); + shell_entries.push_back(ReturnValue::Value(value)) } + + Ok(shell_entries) } diff --git a/src/commands/ps.rs b/src/commands/ps.rs index c06543f4f4..8e34dab582 100644 --- a/src/commands/ps.rs +++ b/src/commands/ps.rs @@ -2,24 +2,18 @@ use crate::errors::ShellError; use crate::object::process::process_dict; use crate::object::Value; use crate::prelude::*; -use derive_new::new; use sysinfo::SystemExt; -#[derive(new)] -pub struct Ps; +pub fn ps(_args: CommandArgs<'caller>) -> Result, ShellError> { + let mut system = sysinfo::System::new(); + system.refresh_all(); -impl crate::Command for Ps { - fn run(&self, _args: CommandArgs<'caller>) -> Result, ShellError> { - let mut system = sysinfo::System::new(); - system.refresh_all(); + let list = system.get_process_list(); - let list = system.get_process_list(); + let list = list + .into_iter() + .map(|(_, process)| ReturnValue::Value(Value::Object(process_dict(process)))) + .collect::>(); - let list = list - .into_iter() - .map(|(_, process)| ReturnValue::Value(Value::Object(process_dict(process)))) - .collect::>(); - - Ok(list) - } + Ok(list) } diff --git a/src/commands/reject.rs b/src/commands/reject.rs index 4780ac0131..c7ab2b0142 100644 --- a/src/commands/reject.rs +++ b/src/commands/reject.rs @@ -1,28 +1,22 @@ use crate::errors::ShellError; -use crate::object::base::reject; +use crate::object::base::reject_fields; use crate::object::Value; use crate::prelude::*; -use derive_new::new; -#[derive(new)] -pub struct Reject; - -impl crate::Command for Reject { - fn run(&self, args: CommandArgs<'value>) -> Result, ShellError> { - if args.args.is_empty() { - return Err(ShellError::string("select requires a field")); - } - - let fields: Result, _> = args.args.iter().map(|a| a.as_string()).collect(); - let fields = fields?; - - let objects = args - .input - .iter() - .map(|item| Value::Object(reject(item, &fields))) - .map(|item| ReturnValue::Value(item)) - .collect(); - - Ok(objects) +pub fn reject(args: CommandArgs<'value>) -> Result, ShellError> { + if args.args.is_empty() { + return Err(ShellError::string("select requires a field")); } + + let fields: Result, _> = args.args.iter().map(|a| a.as_string()).collect(); + let fields = fields?; + + let objects = args + .input + .iter() + .map(|item| Value::Object(reject_fields(item, &fields))) + .map(|item| ReturnValue::Value(item)) + .collect(); + + Ok(objects) } diff --git a/src/commands/select.rs b/src/commands/select.rs index 15298c9c2a..6e346ed567 100644 --- a/src/commands/select.rs +++ b/src/commands/select.rs @@ -1,28 +1,22 @@ use crate::errors::ShellError; -use crate::object::base::select; +use crate::object::base::select_fields; use crate::object::Value; use crate::prelude::*; -use derive_new::new; -#[derive(new)] -pub struct Select; - -impl crate::Command for Select { - fn run(&self, args: CommandArgs<'caller>) -> Result, ShellError> { - if args.args.is_empty() { - return Err(ShellError::string("select requires a field")); - } - - let fields: Result, _> = args.args.iter().map(|a| a.as_string()).collect(); - let fields = fields?; - - let objects = args - .input - .iter() - .map(|item| Value::Object(select(item, &fields))) - .map(|item| ReturnValue::Value(item)) - .collect(); - - Ok(objects) +pub fn select(args: CommandArgs<'caller>) -> Result, ShellError> { + if args.args.is_empty() { + return Err(ShellError::string("select requires a field")); } + + let fields: Result, _> = args.args.iter().map(|a| a.as_string()).collect(); + let fields = fields?; + + let objects = args + .input + .iter() + .map(|item| Value::Object(select_fields(item, &fields))) + .map(|item| ReturnValue::Value(item)) + .collect(); + + Ok(objects) } diff --git a/src/commands/skip.rs b/src/commands/skip.rs index d085e5fd8e..f1059adce7 100644 --- a/src/commands/skip.rs +++ b/src/commands/skip.rs @@ -1,29 +1,21 @@ use crate::errors::ShellError; use crate::prelude::*; -use derive_new::new; -#[derive(new)] -pub struct Skip; +pub fn skip(args: CommandArgs<'caller>) -> Result, ShellError> { + let amount = args.args[0].as_int()?; -// TODO: "Amount remaining" wrapper + let amount = if args.input.len() > amount as usize { + amount as usize + } else { + args.input.len() + }; -impl crate::Command for Skip { - fn run(&self, args: CommandArgs<'caller>) -> Result, ShellError> { - let amount = args.args[0].as_int()?; + let out: VecDeque = args + .input + .into_iter() + .skip(amount) + .map(|v| ReturnValue::Value(v)) + .collect(); - let amount = if args.input.len() > amount as usize { - amount as usize - } else { - args.input.len() - }; - - let out: VecDeque = args - .input - .into_iter() - .skip(amount) - .map(|v| ReturnValue::Value(v)) - .collect(); - - Ok(out) - } + Ok(out) } diff --git a/src/commands/sort_by.rs b/src/commands/sort_by.rs index d0681c2232..0f289fdfdf 100644 --- a/src/commands/sort_by.rs +++ b/src/commands/sort_by.rs @@ -1,29 +1,23 @@ use crate::errors::ShellError; use crate::prelude::*; -use derive_new::new; -#[derive(new)] -pub struct SortBy; +pub fn sort_by(args: CommandArgs<'caller>) -> Result, ShellError> { + let fields: Result, _> = args.args.iter().map(|a| a.as_string()).collect(); + let fields = fields?; -impl crate::Command for SortBy { - fn run(&self, args: CommandArgs<'caller>) -> Result, ShellError> { - let fields: Result, _> = args.args.iter().map(|a| a.as_string()).collect(); - let fields = fields?; + let mut output = args.input.into_iter().collect::>(); - let mut output = args.input.into_iter().collect::>(); - - output.sort_by_key(|item| { - fields - .iter() - .map(|f| item.get_data_by_key(f).borrow().copy()) - .collect::>() - }); - - let output = output + output.sort_by_key(|item| { + fields .iter() - .map(|o| ReturnValue::Value(o.copy())) - .collect(); + .map(|f| item.get_data_by_key(f).borrow().copy()) + .collect::>() + }); - Ok(output) - } + let output = output + .iter() + .map(|o| ReturnValue::Value(o.copy())) + .collect(); + + Ok(output) } diff --git a/src/commands/take.rs b/src/commands/take.rs index c4753e0d6f..540ec4204d 100644 --- a/src/commands/take.rs +++ b/src/commands/take.rs @@ -1,29 +1,23 @@ use crate::errors::ShellError; use crate::prelude::*; -use derive_new::new; - -#[derive(new)] -pub struct Take; // TODO: "Amount remaining" wrapper -impl crate::Command for Take { - fn run(&self, args: CommandArgs<'caller>) -> Result, ShellError> { - let amount = args.args[0].as_int()?; +pub fn take(args: CommandArgs<'caller>) -> Result, ShellError> { + let amount = args.args[0].as_int()?; - let amount = if args.input.len() > amount as usize { - amount as usize - } else { - args.input.len() - }; + let amount = if args.input.len() > amount as usize { + amount as usize + } else { + args.input.len() + }; - let out: VecDeque = args - .input - .into_iter() - .take(amount) - .map(|v| ReturnValue::Value(v)) - .collect(); + let out: VecDeque = args + .input + .into_iter() + .take(amount) + .map(|v| ReturnValue::Value(v)) + .collect(); - Ok(out) - } + Ok(out) } diff --git a/src/commands/to_array.rs b/src/commands/to_array.rs index f20ee55dcd..6ae59714d5 100644 --- a/src/commands/to_array.rs +++ b/src/commands/to_array.rs @@ -1,19 +1,13 @@ use crate::errors::ShellError; use crate::object::Value; use crate::prelude::*; -use derive_new::new; -#[derive(new)] -pub struct ToArray; - -impl crate::Command for ToArray { - fn run(&self, args: CommandArgs<'caller>) -> Result, ShellError> { - let out = args.input.into_iter().collect(); - Ok(ReturnValue::single(Value::List(out))) - } +pub fn to_array(args: CommandArgs<'caller>) -> Result, ShellError> { + let out = args.input.into_iter().collect(); + Ok(ReturnValue::single(Value::List(out))) } -crate fn to_array(stream: VecDeque) -> VecDeque { +crate fn stream_to_array(stream: VecDeque) -> VecDeque { let out = Value::List(stream.into_iter().collect()); let mut stream = VecDeque::new(); stream.push_back(out); diff --git a/src/commands/view.rs b/src/commands/view.rs index b7b0023f93..728fa93623 100644 --- a/src/commands/view.rs +++ b/src/commands/view.rs @@ -1,32 +1,26 @@ use crate::errors::ShellError; use crate::prelude::*; -use derive_new::new; use prettyprint::PrettyPrinter; -#[derive(new)] -pub struct View; +pub fn view(args: CommandArgs<'caller>) -> Result, ShellError> { + let target = match args.args.first() { + // TODO: This needs better infra + None => return Err(ShellError::string(format!("cat must take one arg"))), + Some(v) => v.as_string()?.clone(), + }; -impl crate::Command for View { - fn run(&self, args: CommandArgs<'caller>) -> Result, ShellError> { - let target = match args.args.first() { - // TODO: This needs better infra - None => return Err(ShellError::string(format!("cat must take one arg"))), - Some(v) => v.as_string()?.clone(), - }; + let cwd = args.env.cwd().to_path_buf(); - let cwd = args.env.cwd().to_path_buf(); + let printer = PrettyPrinter::default() + .line_numbers(false) + .header(false) + .grid(false) + .build() + .map_err(|e| ShellError::string(e))?; - let printer = PrettyPrinter::default() - .line_numbers(false) - .header(false) - .grid(false) - .build() - .map_err(|e| ShellError::string(e))?; + let file = cwd.join(target); - let file = cwd.join(target); + let _ = printer.file(file.display().to_string()); - let _ = printer.file(file.display().to_string()); - - Ok(VecDeque::new()) - } + Ok(VecDeque::new()) } diff --git a/src/commands/where_.rs b/src/commands/where_.rs index 3db7e5fa8b..17f53e61bc 100644 --- a/src/commands/where_.rs +++ b/src/commands/where_.rs @@ -1,35 +1,29 @@ use crate::errors::ShellError; use crate::object::base::find; use crate::prelude::*; -use derive_new::new; -#[derive(new)] -pub struct Where; +pub fn r#where(args: CommandArgs<'caller>) -> Result, ShellError> { + if args.args.is_empty() { + return Err(ShellError::string("select requires a field")); + } -impl crate::Command for Where { - fn run(&self, args: CommandArgs<'caller>) -> Result, ShellError> { - if args.args.is_empty() { - return Err(ShellError::string("select requires a field")); + let field: Result = args.args[0].as_string(); + let field = field?; + + match args.args[1] { + Value::Primitive(Primitive::Operator(ref operator)) => { + let objects = args + .input + .iter() + .filter(|item| find(&item, &field, operator, &args.args[2])) + .map(|item| ReturnValue::Value(item.copy())) + .collect(); + + Ok(objects) } - - let field: Result = args.args[0].as_string(); - let field = field?; - - match args.args[1] { - Value::Primitive(Primitive::Operator(ref operator)) => { - let objects = args - .input - .iter() - .filter(|item| find(&item, &field, operator, &args.args[2])) - .map(|item| ReturnValue::Value(item.copy())) - .collect(); - - Ok(objects) - } - ref x => { - println!("{:?}", x); - Err(ShellError::string("expected a comparison operator")) - } + ref x => { + println!("{:?}", x); + Err(ShellError::string("expected a comparison operator")) } } } diff --git a/src/context.rs b/src/context.rs index e87d23ff6b..c60b97b2f8 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1,9 +1,10 @@ use crate::prelude::*; use std::error::Error; +use std::sync::Arc; pub struct Context { - commands: indexmap::IndexMap>, + commands: indexmap::IndexMap>, crate host: Box, crate env: Environment, } @@ -17,35 +18,33 @@ impl Context { }) } - pub fn add_commands(&mut self, commands: Vec<(&str, Box)>) { + pub fn add_commands(&mut self, commands: Vec<(&str, Arc)>) { for (name, command) in commands { self.commands.insert(name.to_string(), command); } } - crate fn has_command(&mut self, name: &str) -> bool { + crate fn has_command(&self, name: &str) -> bool { self.commands.contains_key(name) } + crate fn get_command(&self, name: &str) -> Arc { + self.commands.get(name).unwrap().clone() + } + crate fn run_command( - &self, - name: &str, + &mut self, + command: Arc, arg_list: Vec, input: VecDeque, ) -> Result, ShellError> { let command_args = CommandArgs { - host: &self.host, + host: &mut self.host, env: &self.env, args: arg_list, input, }; - match self.commands.get(name) { - None => Err(ShellError::string(format!( - "Command {} did not exist", - name - ))), - Some(command) => command.run(command_args), - } + command.run(command_args) } } diff --git a/src/format.rs b/src/format.rs index 10c5ff04ca..4b0b9a4445 100644 --- a/src/format.rs +++ b/src/format.rs @@ -5,9 +5,6 @@ crate mod table; use crate::prelude::*; -use crate::Context; -use std::sync::{Arc, Mutex}; - crate use entries::{EntriesListView, EntriesView}; crate use generic::GenericView; crate use table::TableView; @@ -22,7 +19,7 @@ fn print_rendered(lines: &[String], host: &mut dyn Host) { } } -crate fn print_view(view: &impl RenderView, context: Arc>) { - let mut ctx = context.lock().unwrap(); - crate::format::print_rendered(&view.render_view(&ctx.host), &mut ctx.host); +crate fn print_view(view: &impl RenderView, host: &mut Host) { + // let mut ctx = context.lock().unwrap(); + crate::format::print_rendered(&view.render_view(host), host); } diff --git a/src/main.rs b/src/main.rs index 8170d63516..1422ab4515 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,8 +14,9 @@ mod parser; mod prelude; mod shell; +use crate::commands::classified::{ClassifiedCommand, ExternalCommand, InternalCommand}; use crate::commands::command::ReturnValue; -crate use crate::commands::command::{Command, CommandAction, CommandBlueprint}; +crate use crate::commands::command::{Command, CommandAction}; use crate::context::Context; crate use crate::env::{Environment, Host}; crate use crate::errors::ShellError; @@ -26,8 +27,7 @@ use rustyline::error::ReadlineError; use rustyline::{self, ColorMode, Config, Editor}; use std::collections::VecDeque; use std::error::Error; -use std::sync::{Arc, Mutex}; -use subprocess::Exec; +use std::sync::Arc; #[derive(Debug)] pub enum MaybeOwned<'a, T> { @@ -59,39 +59,38 @@ fn main() -> Result<(), Box> { println!("No previous history."); } - let context = Arc::new(Mutex::new(Context::basic()?)); + let mut context = Context::basic()?; { use crate::commands::*; - context.lock().unwrap().add_commands(vec![ - ("ps", Box::new(ps::Ps)), - ("ls", Box::new(ls::Ls)), - ("cd", Box::new(cd::Cd)), - ("view", Box::new(view::View)), - ("skip", Box::new(skip::Skip)), - ("take", Box::new(take::Take)), - ("select", Box::new(select::Select)), - ("reject", Box::new(reject::Reject)), - ("to-array", Box::new(to_array::ToArray)), - ("where", Box::new(where_::Where)), - ("sort-by", Box::new(sort_by::SortBy)), + context.add_commands(vec![ + ("format", Arc::new(format)), + ("format-list", Arc::new(format_list)), + ("ps", Arc::new(ps::ps)), + ("ls", Arc::new(ls::ls)), + ("cd", Arc::new(cd::cd)), + ("view", Arc::new(view::view)), + ("skip", Arc::new(skip::skip)), + ("take", Arc::new(take::take)), + ("select", Arc::new(select::select)), + ("reject", Arc::new(reject::reject)), + ("to-array", Arc::new(to_array::to_array)), + ("where", Arc::new(where_::r#where)), + ("sort-by", Arc::new(sort_by::sort_by)), ]); } loop { - let readline = rl.readline(&format!( - "{}> ", - context.lock().unwrap().env.cwd().display().to_string() - )); + let readline = rl.readline(&format!("{}> ", context.env.cwd().display().to_string())); - match process_line(readline, context.clone()) { + match process_line(readline, &mut context) { LineResult::Success(line) => { rl.add_history_entry(line.clone()); } LineResult::Error(err) => { - context.lock().unwrap().host.stdout(&err); + context.host.stdout(&err); } LineResult::Break => { @@ -100,8 +99,6 @@ fn main() -> Result<(), Box> { LineResult::FatalError(err) => { context - .lock() - .unwrap() .host .stdout(&format!("A surprising fatal error occurred.\n{:?}", err)); } @@ -121,10 +118,7 @@ enum LineResult { FatalError(ShellError), } -fn process_line( - readline: Result, - context: Arc>, -) -> LineResult { +fn process_line(readline: Result, ctx: &mut Context) -> LineResult { match &readline { Ok(line) if line.trim() == "exit" => LineResult::Break, @@ -144,11 +138,7 @@ fn process_line( let mut input = VecDeque::new(); for item in parsed { - input = match process_command( - item.clone(), - input, - context.clone(), - ) { + input = match process_command(item.clone(), input, ctx) { Ok(val) => val, Err(err) => return LineResult::Error(format!("{}", err.description())), }; @@ -156,9 +146,18 @@ fn process_line( if input.len() > 0 { if equal_shapes(&input) { - format(crate::commands::to_array(input), context.clone()); + let array = crate::commands::stream_to_array(input); + let args = CommandArgs::from_context(ctx, vec![], array); + match format(args) { + Ok(_) => {} + Err(err) => return LineResult::Error(err.to_string()), + } } else { - format(input, context.clone()); + let args = CommandArgs::from_context(ctx, vec![], input); + match format(args) { + Ok(_) => {} + Err(err) => return LineResult::Error(err.to_string()), + } } } @@ -182,69 +181,58 @@ fn process_line( fn process_command( parsed: Vec, input: VecDeque, - context: Arc>, + context: &mut Context, ) -> Result, ShellError> { - let command = &parsed[0].name()?; - let arg_list = parsed[1..].iter().map(|i| i.as_value()).collect(); - let arg_list_strings: Vec = parsed[1..].iter().map(|i| i.print()).collect(); + let command = classify_command(&parsed, context)?; - if command == &"format" { - format(input, context); + command.run(input, context) +} - Ok(VecDeque::new()) - } else if command == &"format-list" { - let view = EntriesListView::from_stream(input); +fn classify_command( + command: &[crate::parser::Item], + context: &Context, +) -> Result { + let command_name = &command[0].name()?; - crate::format::print_view(&view, context.clone()); + let arg_list: Vec = command[1..].iter().map(|i| i.as_value()).collect(); + let arg_list_strings: Vec = command[1..].iter().map(|i| i.print()).collect(); - Ok(VecDeque::new()) - } else { - let mut ctx = context.lock().unwrap(); - - match ctx.has_command(*command) { + match *command_name { + other => match context.has_command(*command_name) { true => { - // let mut instance = ctx.create_command(command, arg_list)?; - - let result = ctx.run_command(command, arg_list, input)?; - - // let result = command.run(input_args)?; - let mut next = VecDeque::new(); - - for v in result { - match v { - ReturnValue::Action(action) => match action { - crate::CommandAction::ChangeCwd(cwd) => ctx.env.cwd = cwd, - }, - - ReturnValue::Value(v) => next.push_back(v), - } - } - - Ok(next) + let command = context.get_command(command_name); + Ok(ClassifiedCommand::Internal(InternalCommand { + command, + args: arg_list, + })) } - - false => { - Exec::shell(command) - .args(&arg_list_strings) - .cwd(ctx.env.cwd()) - .join() - .unwrap(); - Ok(VecDeque::new()) - } - } + false => Ok(ClassifiedCommand::External(ExternalCommand { + name: other.to_string(), + args: arg_list_strings, + })), + }, } } -fn format(input: VecDeque, context: Arc>) { - let last = input.len() - 1; - for (i, item) in input.iter().enumerate() { +fn format(args: CommandArgs<'caller>) -> Result, ShellError> { + let last = args.input.len() - 1; + for (i, item) in args.input.iter().enumerate() { let view = GenericView::new(item); - crate::format::print_view(&view, context.clone()); + crate::format::print_view(&view, args.host); if last != i { println!(""); } } + + Ok(VecDeque::new()) +} + +fn format_list(args: CommandArgs<'caller>) -> Result, ShellError> { + let view = EntriesListView::from_stream(args.input); + crate::format::print_view(&view, args.host); + + Ok(VecDeque::new()) } fn equal_shapes(input: &VecDeque) -> bool { diff --git a/src/object/base.rs b/src/object/base.rs index 66c591971f..dae2d2e4e1 100644 --- a/src/object/base.rs +++ b/src/object/base.rs @@ -1,11 +1,11 @@ use crate::errors::ShellError; use crate::object::desc::DataDescriptor; +use crate::parser::parse::Operator; use ansi_term::Color; use chrono::{DateTime, Utc}; use chrono_humanize::Humanize; use ordered_float::OrderedFloat; use std::time::SystemTime; -use crate::parser::parse::Operator; type OF64 = OrderedFloat; @@ -50,7 +50,7 @@ impl Primitive { (false, Some(_)) => format!(""), }, Primitive::Date(d) => format!("{}", d.humanize()), - Primitive::Operator(o) => o.print() + Primitive::Operator(o) => o.print(), } } } @@ -196,7 +196,7 @@ impl Value { } } -crate fn select(obj: &Value, fields: &[String]) -> crate::object::Dictionary { +crate fn select_fields(obj: &Value, fields: &[String]) -> crate::object::Dictionary { let mut out = crate::object::Dictionary::default(); let descs = obj.data_descriptors(); @@ -211,7 +211,7 @@ crate fn select(obj: &Value, fields: &[String]) -> crate::object::Dictionary { out } -crate fn reject(obj: &Value, fields: &[String]) -> crate::object::Dictionary { +crate fn reject_fields(obj: &Value, fields: &[String]) -> crate::object::Dictionary { let mut out = crate::object::Dictionary::default(); let descs = obj.data_descriptors(); @@ -243,18 +243,28 @@ crate fn find(obj: &Value, field: &str, op: &Operator, rhs: &Value) -> bool { }, Value::Primitive(Primitive::Bytes(i)) => match (op, rhs) { (Operator::LessThan, Value::Primitive(Primitive::Int(i2))) => i < (*i2 as u128), - (Operator::GreaterThan, Value::Primitive(Primitive::Int(i2))) => i > (*i2 as u128), - (Operator::LessThanOrEqual, Value::Primitive(Primitive::Int(i2))) => i <= (*i2 as u128), - (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Int(i2))) => i >= (*i2 as u128), + (Operator::GreaterThan, Value::Primitive(Primitive::Int(i2))) => { + i > (*i2 as u128) + } + (Operator::LessThanOrEqual, Value::Primitive(Primitive::Int(i2))) => { + i <= (*i2 as u128) + } + (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Int(i2))) => { + i >= (*i2 as u128) + } (Operator::Equal, Value::Primitive(Primitive::Int(i2))) => i == (*i2 as u128), - (Operator::NotEqual, Value::Primitive(Primitive::Int(i2))) => i != (*i2 as u128), + (Operator::NotEqual, Value::Primitive(Primitive::Int(i2))) => { + i != (*i2 as u128) + } _ => false, }, Value::Primitive(Primitive::Int(i)) => match (op, rhs) { (Operator::LessThan, Value::Primitive(Primitive::Int(i2))) => i < *i2, (Operator::GreaterThan, Value::Primitive(Primitive::Int(i2))) => i > *i2, (Operator::LessThanOrEqual, Value::Primitive(Primitive::Int(i2))) => i <= *i2, - (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Int(i2))) => i >= *i2, + (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Int(i2))) => { + i >= *i2 + } (Operator::Equal, Value::Primitive(Primitive::Int(i2))) => i == *i2, (Operator::NotEqual, Value::Primitive(Primitive::Int(i2))) => i != *i2, _ => false, @@ -263,15 +273,29 @@ crate fn find(obj: &Value, field: &str, op: &Operator, rhs: &Value) -> bool { (Operator::LessThan, Value::Primitive(Primitive::Float(i2))) => i < *i2, (Operator::GreaterThan, Value::Primitive(Primitive::Float(i2))) => i > *i2, (Operator::LessThanOrEqual, Value::Primitive(Primitive::Float(i2))) => i <= *i2, - (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Float(i2))) => i >= *i2, + (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Float(i2))) => { + i >= *i2 + } (Operator::Equal, Value::Primitive(Primitive::Float(i2))) => i == *i2, (Operator::NotEqual, Value::Primitive(Primitive::Float(i2))) => i != *i2, - (Operator::LessThan, Value::Primitive(Primitive::Int(i2))) => (i.into_inner()) < *i2 as f64, - (Operator::GreaterThan, Value::Primitive(Primitive::Int(i2))) => i.into_inner() > *i2 as f64, - (Operator::LessThanOrEqual, Value::Primitive(Primitive::Int(i2))) => i.into_inner() <= *i2 as f64, - (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Int(i2))) => i.into_inner() >= *i2 as f64, - (Operator::Equal, Value::Primitive(Primitive::Int(i2))) => i.into_inner() == *i2 as f64, - (Operator::NotEqual, Value::Primitive(Primitive::Int(i2))) => i.into_inner() != *i2 as f64, + (Operator::LessThan, Value::Primitive(Primitive::Int(i2))) => { + (i.into_inner()) < *i2 as f64 + } + (Operator::GreaterThan, Value::Primitive(Primitive::Int(i2))) => { + i.into_inner() > *i2 as f64 + } + (Operator::LessThanOrEqual, Value::Primitive(Primitive::Int(i2))) => { + i.into_inner() <= *i2 as f64 + } + (Operator::GreaterThanOrEqual, Value::Primitive(Primitive::Int(i2))) => { + i.into_inner() >= *i2 as f64 + } + (Operator::Equal, Value::Primitive(Primitive::Int(i2))) => { + i.into_inner() == *i2 as f64 + } + (Operator::NotEqual, Value::Primitive(Primitive::Int(i2))) => { + i.into_inner() != *i2 as f64 + } _ => false, }, diff --git a/src/parser/completer.rs b/src/parser/completer.rs index f0efbf7519..98328e96c1 100644 --- a/src/parser/completer.rs +++ b/src/parser/completer.rs @@ -3,7 +3,7 @@ use std::collections::BTreeMap; #[allow(unused)] crate struct Completer { - commands: BTreeMap>, + commands: BTreeMap>, } impl completion::Completer for Completer { diff --git a/src/prelude.rs b/src/prelude.rs index 3dec21a321..a0eb2b3d21 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -1,4 +1,4 @@ -crate use crate::commands::command::{CommandArgs, ReturnValue}; +crate use crate::commands::command::{Command, CommandArgs, ReturnValue}; crate use crate::env::{Environment, Host}; crate use crate::errors::ShellError; crate use crate::object::{Primitive, Value};