diff --git a/Cargo.lock b/Cargo.lock index 5a01e25..eb25cdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,595 +1,590 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "aho-corasick" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr", ] [[package]] name = "argon2rs" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392" dependencies = [ - "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2-rfc", + "scoped_threadpool", ] [[package]] name = "arrayvec" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71" dependencies = [ - "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "nodrop", ] [[package]] name = "autocfg" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799" [[package]] name = "backtrace" version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd5a90e2b463010cd0e0ce9a11d4a9d5d58d9f41d4a6ba3dcaf9e68b466e88b4" 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.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "backtrace-sys", + "cfg-if", + "libc", + "rustc-demangle", + "winapi", ] [[package]] name = "backtrace-sys" version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" dependencies = [ - "cc 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "libc", ] [[package]] name = "bitflags" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" [[package]] name = "blake2-rfc" version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" dependencies = [ - "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec", + "constant_time_eq", ] [[package]] name = "c2-chacha" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" dependencies = [ - "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ppv-lite86", ] [[package]] name = "cc" version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01c69d08ff207f231f07196e30f84c70f1c815b04f980f8b7b01ff01f05eb92" [[package]] name = "cfg-if" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" [[package]] name = "cloudabi" version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" dependencies = [ - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", ] [[package]] name = "common" version = "0.8.2" dependencies = [ - "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "dirs", + "libc", + "rand", + "serde", ] [[package]] name = "constant_time_eq" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" [[package]] name = "dirs" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "dirs-sys", ] [[package]] name = "dirs-sys" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "redox_users", + "winapi", ] [[package]] name = "docopt" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f525a586d310c87df72ebcd98009e57f1cc030c8c268305287a476beb653969" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", + "regex", + "serde", + "strsim", ] [[package]] name = "dtoa" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" [[package]] name = "edit" version = "0.8.2" dependencies = [ - "common 0.8.2", - "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "common", + "dirs", + "libc", ] [[package]] name = "failure" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" dependencies = [ - "backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace", + "failure_derive", ] [[package]] name = "failure_derive" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" dependencies = [ - "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.27 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27", + "quote 0.6.11", + "syn 0.15.27", + "synstructure", ] [[package]] name = "fuchsia-cprng" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "getrandom" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "wasi", ] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" version = "0.2.66" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" [[package]] name = "linked-hash-map" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "linked-hash-map" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "list" version = "0.8.2" dependencies = [ - "common 0.8.2", + "common", ] [[package]] name = "load" version = "0.8.2" dependencies = [ - "common 0.8.2", - "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "snapshot 0.8.2", - "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "common", + "dirs", + "libc", + "rand", + "snapshot", + "yaml-rust", ] [[package]] name = "memchr" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" [[package]] name = "muxed" version = "0.8.2" dependencies = [ - "common 0.8.2", - "docopt 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "edit 0.8.2", - "list 0.8.2", - "load 0.8.2", - "new 0.8.2", - "snapshot 0.8.2", + "common", + "docopt", + "edit", + "list", + "load", + "new", + "snapshot", ] [[package]] name = "new" version = "0.8.2" dependencies = [ - "common 0.8.2", + "common", ] [[package]] name = "nodrop" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" [[package]] name = "ppv-lite86" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" [[package]] name = "proc-macro2" version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915" dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0", ] [[package]] name = "proc-macro2" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" dependencies = [ - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0", ] [[package]] name = "quote" version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1" dependencies = [ - "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27", ] [[package]] name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6", ] [[package]] name = "rand" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", + "libc", + "rand_chacha", + "rand_core 0.5.1", + "rand_hc", ] [[package]] name = "rand_chacha" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" dependencies = [ - "c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "c2-chacha", + "rand_core 0.5.1", ] [[package]] name = "rand_core" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" dependencies = [ - "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0", ] [[package]] name = "rand_core" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", ] [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1", ] [[package]] name = "rand_os" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c690732391ae0abafced5015ffb53656abfaec61b342290e5eb56b286a679d" 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.66 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.0", + "rdrand", + "winapi", ] [[package]] name = "rdrand" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1", ] [[package]] name = "redox_syscall" version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "423e376fffca3dfa06c9e9790a9ccd282fafb3cc6e6397d01dbf64f9bacc6b85" [[package]] name = "redox_users" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fe5204c3a17e97dde73f285d49be585df59ed84b50a872baf416e73b62c3828" dependencies = [ - "argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)", + "argon2rs", + "failure", + "rand_os", + "redox_syscall", ] [[package]] name = "regex" version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" dependencies = [ - "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", ] [[package]] name = "regex-syntax" version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" [[package]] name = "rustc-demangle" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619" [[package]] name = "scoped_threadpool" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" [[package]] name = "serde" version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" dependencies = [ - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6", + "quote 1.0.2", + "syn 1.0.11", ] [[package]] name = "serde_yaml" version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" dependencies = [ - "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "dtoa", + "linked-hash-map", + "serde", + "yaml-rust", ] [[package]] name = "snapshot" version = "0.8.2" dependencies = [ - "common 0.8.2", - "new 0.8.2", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", + "common", + "new", + "regex", + "serde", + "serde_yaml", ] [[package]] name = "strsim" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "032c03039aae92b350aad2e3779c352e104d919cb192ba2fabbd7b831ce4f0f6" [[package]] name = "syn" version = "0.15.27" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525bd55255f03c816e5d7f615587bd13030c7103354fadb104993dcee6a788ec" dependencies = [ - "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27", + "quote 0.6.11", + "unicode-xid 0.1.0", ] [[package]] name = "syn" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6", + "quote 1.0.2", + "unicode-xid 0.2.0", ] [[package]] name = "synstructure" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" dependencies = [ - "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.27 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.27", + "quote 0.6.11", + "syn 0.15.27", + "unicode-xid 0.1.0", ] [[package]] name = "thread_local" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", ] [[package]] name = "unicode-xid" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" [[package]] name = "wasi" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" [[package]] name = "winapi" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "yaml-rust" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[metadata] -"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" -"checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392" -"checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71" -"checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799" -"checksum backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "cd5a90e2b463010cd0e0ce9a11d4a9d5d58d9f41d4a6ba3dcaf9e68b466e88b4" -"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" -"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" -"checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" -"checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" -"checksum cc 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)" = "d01c69d08ff207f231f07196e30f84c70f1c815b04f980f8b7b01ff01f05eb92" -"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" -"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" -"checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" -"checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" -"checksum docopt 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f525a586d310c87df72ebcd98009e57f1cc030c8c268305287a476beb653969" -"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" -"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" -"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -"checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" -"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" -"checksum linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d262045c5b87c0861b3f004610afd0e2c851e2908d08b6c870cbb9d5f494ecd" -"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" -"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" -"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" -"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" -"checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915" -"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" -"checksum quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1" -"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" -"checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" -"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" -"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" -"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -"checksum rand_os 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b7c690732391ae0abafced5015ffb53656abfaec61b342290e5eb56b286a679d" -"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -"checksum redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)" = "423e376fffca3dfa06c9e9790a9ccd282fafb3cc6e6397d01dbf64f9bacc6b85" -"checksum redox_users 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe5204c3a17e97dde73f285d49be585df59ed84b50a872baf416e73b62c3828" -"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" -"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" -"checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619" -"checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" -"checksum serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" -"checksum serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" -"checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" -"checksum strsim 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "032c03039aae92b350aad2e3779c352e104d919cb192ba2fabbd7b831ce4f0f6" -"checksum syn 0.15.27 (registry+https://github.com/rust-lang/crates.io-index)" = "525bd55255f03c816e5d7f615587bd13030c7103354fadb104993dcee6a788ec" -"checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" -"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" -"checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" -"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] diff --git a/common/Cargo.toml b/common/Cargo.toml index 7204c21..0197c6c 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -8,3 +8,4 @@ publish = false dirs = "2.0.2" rand = "0.7.2" serde = { version = "1.0.103", features = ["derive"] } +libc = "0.2.66" diff --git a/common/src/lib.rs b/common/src/lib.rs index 305d4a3..82e5a29 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,4 +1,5 @@ extern crate dirs; +extern crate libc; extern crate rand; extern crate serde; @@ -6,3 +7,4 @@ pub mod args; pub mod first_run; pub mod project_paths; pub mod rand_names; +pub mod tmux; diff --git a/load/src/tmux/config.rs b/common/src/tmux/config.rs similarity index 100% rename from load/src/tmux/config.rs rename to common/src/tmux/config.rs diff --git a/load/src/tmux/mod.rs b/common/src/tmux/mod.rs similarity index 52% rename from load/src/tmux/mod.rs rename to common/src/tmux/mod.rs index 90a672f..17af6d0 100644 --- a/load/src/tmux/mod.rs +++ b/common/src/tmux/mod.rs @@ -19,7 +19,7 @@ static TMUX_NAME: &str = "tmux"; /// The gateway to calling any functions on tmux. Most public functions in this /// module will be fed through this `call` function. This safely creates a new /// thread to execute the command on. We say "Most" public functions will use -/// this as `attach` specificaly does not use it. +/// this as `attach` specifically does not use it. /// /// args: The command we will send to tmux on the host system for execution. /// @@ -37,7 +37,7 @@ pub fn call(args: &[&str]) -> Result { Command::new(TMUX_NAME).args(args).output() } -/// Has session is used firgure out if a named session is already running. +/// Has session is used figure out if a named session is already running. /// /// `target`: A string represented by the `{named_session}` /// @@ -68,11 +68,113 @@ pub fn has_session(target: &str) -> ExitStatus { /// tmux::get_config(); /// ``` pub fn get_config() -> String { - let output = call(&["start-server", ";", "show-options", "-g", ";", "show-options", "-g", "-w"]) - .expect("couldn't get tmux options"); + let output = call(&[ + "start-server", + ";", + "show-options", + "-g", + ";", + "show-options", + "-g", + "-w", + ]) + .expect("couldn't get tmux options"); String::from_utf8_lossy(&output.stdout).to_string() } +pub struct Session { + pub name: String, + pub id: String, + pub client_attached: usize, + pub created_at: u64, + pub last_attached: u64, +} + +pub struct SessionList { + pub sessions: Vec, +} + +impl SessionList { + pub fn new(sessions: Vec) -> SessionList { + SessionList { sessions } + } + + pub fn has_session(&self, name: &str) -> bool { + self.sessions.iter().any(|s| s.name == name) + } + + pub fn is_attached(&self, name: &str) -> bool { + self.sessions + .iter() + .any(|s| s.name == name && s.client_attached > 0) + } + + pub fn get_last_attached(&self, name: &str) -> Option { + self.sessions + .iter() + .find(|s| s.name == name) + .map(|s| s.last_attached) + } +} + +impl Session { + pub fn from_formatted_str(formatted: &str) -> Session { + let mut split = formatted.split(' '); + let name = split.next().unwrap().to_string(); + let id = split.next().unwrap().to_string(); + let client_attached = split + .next() + .unwrap() + .parse::() + .expect("Bad client_attached"); + let created_at = split + .next() + .unwrap() + .parse::() + .expect("Bad created_at"); + let last_attached = split + .next() + .unwrap() + .parse::() + .expect("Bad last_attached"); + + Session { + name, + id, + client_attached, + created_at, + last_attached, + } + } +} + +/// Read the current tmux sessions from the server +/// +/// # Examples +/// +/// ```rust +/// extern crate load; +/// use load::tmux; +/// +/// let _: tmux::SessionList = tmux::get_sessions(); +/// ``` +pub fn get_sessions() -> SessionList { + let output = call(&[ + "list-sessions", + "-F", + "#{session_name} #{session_id} #{session_attached} #{session_created} #{session_last_attached}", + ]) + .expect("couldn't get tmux sessions"); + let sessions = String::from_utf8_lossy(&output.stdout).to_string(); + let sessions = sessions + .trim() + .split('\n') + .map(Session::from_formatted_str) + .collect::>(); + + SessionList { sessions } +} + /// Attach is called as the last function in a set of commands. After the tmux /// env has been setup by all previous commands this attaches the user to their /// daemonized tmux session. diff --git a/load/src/tmux/target.rs b/common/src/tmux/target.rs similarity index 100% rename from load/src/tmux/target.rs rename to common/src/tmux/target.rs diff --git a/list/src/lib.rs b/list/src/lib.rs index c034f20..b4f8a19 100644 --- a/list/src/lib.rs +++ b/list/src/lib.rs @@ -4,13 +4,16 @@ use common::args::Args; use common::first_run::check_first_run; use common::project_paths::{project_paths, CONFIG_EXTENSION}; +use std::cmp::Reverse; use std::path::PathBuf; pub fn exec(args: Args) -> Result<(), String> { let project_paths = project_paths(&args); check_first_run(&project_paths.project_directory)?; - let mut projects: Vec = project_paths + let tmux_session = common::tmux::get_sessions(); + + let mut project_names: Vec = project_paths .project_directory .read_dir() .map_err(|_| "Could not read the dir")? @@ -25,9 +28,26 @@ pub fn exec(args: Args) -> Result<(), String> { }) .collect(); - &projects.sort(); + project_names.sort_by_key(|name| (Reverse(tmux_session.get_last_attached(name)), name.clone())); + + let project_displays: Vec = project_names + .into_iter() + .map(|name| { + let mut display = name.clone(); + + if tmux_session.has_session(&name) { + display.push('*'); + } + + if tmux_session.is_attached(&name) { + display.push_str(" (attached)"); + } + + display + }) + .collect(); - println!("{}", &projects.join("\t\t")); + println!("{}", &project_displays.join("\t\t")); Ok(()) } diff --git a/list/tests/list.rs b/list/tests/list.rs index f88f726..f90c868 100644 --- a/list/tests/list.rs +++ b/list/tests/list.rs @@ -16,7 +16,7 @@ mod test { fn make_files() -> PathBuf { let dir_name = rand_names::project_path_name(); let dir = PathBuf::from(&dir_name); - + dbg!(&dir); if !&dir.exists() { println!("{:?}", fs::create_dir(&dir)) @@ -24,8 +24,9 @@ mod test { let configs = ["foo.yml", "bar.yml", "muxed.yml"]; for config in &configs { - let path = PathBuf::from(&dir_name).join(config); - let _ = File::create(&path).expect("Muxed list test failed to create test config files."); + let path = PathBuf::from(&dir_name).join(config); + let _ = File::create(&path) + .expect("Muxed list test failed to create test config files."); } dir diff --git a/load/Cargo.toml b/load/Cargo.toml index f59cb71..d47b66d 100644 --- a/load/Cargo.toml +++ b/load/Cargo.toml @@ -8,7 +8,7 @@ publish = false common = { path = "../common" } dirs = "2.0.2" libc = "0.2.66" -yaml-rust = { version = "0.4.3", default-features = false } +yaml-rust = { version = "0.4.5", default-features = false } [dev-dependencies] rand = "0.7.2" diff --git a/load/src/command.rs b/load/src/command.rs index f96dca3..b96657f 100644 --- a/load/src/command.rs +++ b/load/src/command.rs @@ -1,12 +1,12 @@ //! The structures used to manage commands sent over to tmux. +use common::tmux; +use common::tmux::target::*; use std::io; use std::path::PathBuf; use std::process::Output; use std::rc::Rc; use std::{process, str}; -use tmux; -use tmux::target::*; pub trait Command { fn call(&self, debug: bool) -> Result { @@ -44,7 +44,14 @@ impl Session { // TODO: Real logic exists here. Test it! impl Command for Session { fn args(&self) -> Vec<&str> { - let args: Vec<&str> = vec!["new", "-d", "-s", &self.target.arg_string, "-n", &self.window_name]; + let args: Vec<&str> = vec![ + "new", + "-d", + "-s", + &self.target.arg_string, + "-n", + &self.window_name, + ]; match self.root_path.as_ref() { Some(path) => [&args[..], &["-c", path.to_str().unwrap()]].concat(), @@ -85,7 +92,13 @@ impl Window { impl Command for Window { fn args(&self) -> Vec<&str> { - let args: Vec<&str> = vec!["new-window", "-t", &self.session_target.arg_string, "-n", &self.name]; + let args: Vec<&str> = vec![ + "new-window", + "-t", + &self.session_target.arg_string, + "-n", + &self.name, + ]; match self.path.as_ref() { Some(path) => [&args[..], &["-c", path.to_str().unwrap()]].concat(), @@ -163,7 +176,13 @@ impl SendKeys { impl Command for SendKeys { fn args(&self) -> Vec<&str> { - vec!["send-keys", "-t", &self.target.arg_string(), &self.exec, "KPEnter"] + vec![ + "send-keys", + "-t", + &self.target.arg_string(), + &self.exec, + "KPEnter", + ] } } diff --git a/load/src/lib.rs b/load/src/lib.rs index 0717e05..17f65e6 100644 --- a/load/src/lib.rs +++ b/load/src/lib.rs @@ -1,19 +1,17 @@ extern crate dirs; -extern crate libc; extern crate yaml_rust; extern crate common; pub mod command; pub mod project; -pub mod tmux; use args::Args; use command::Commands; use common::project_paths::project_paths; -use common::{args, first_run}; +use common::tmux::config::Config; +use common::{args, first_run, tmux}; use project::parser; -use tmux::config::Config; pub fn exec(args: Args) -> Result<(), String> { let project_paths = project_paths(&args); diff --git a/load/src/project/mod.rs b/load/src/project/mod.rs index cc87850..8003a6e 100644 --- a/load/src/project/mod.rs +++ b/load/src/project/mod.rs @@ -5,11 +5,11 @@ pub mod parser; use command::{Attach, Commands, SwitchClient}; use common::project_paths::ProjectPaths; +use common::tmux::has_session; use first_run::check_first_run; use std::env; use std::fs::File; use std::io::prelude::*; -use tmux::has_session; use yaml_rust::{Yaml, YamlLoader}; static TMUX_ENV_VAR: &str = "TMUX"; diff --git a/load/src/project/parser.rs b/load/src/project/parser.rs index ab1f3fe..c5d09d2 100644 --- a/load/src/project/parser.rs +++ b/load/src/project/parser.rs @@ -2,12 +2,12 @@ //! processed later. use command::*; +use common::tmux::config::Config; +use common::tmux::target::*; use dirs::home_dir; use project; use std::path::{Path, PathBuf}; use std::rc::Rc; -use tmux::config::Config; -use tmux::target::*; use yaml_rust::Yaml; /// Here was pass in the parsed yaml and project name. The purpose of this call @@ -85,16 +85,23 @@ pub fn call<'a>( path.clone(), )?); } else { - commands.push(Window::new( - &project_name, - Rc::new(k.as_str().ok_or_else(|| { - "Windows require being named in your config." - })? - .to_string()), - root.clone() - ).into()); - - let target = WindowTarget::new(Rc::clone(&project_name), k.as_str().unwrap()); + commands.push( + Window::new( + &project_name, + Rc::new( + k.as_str() + .ok_or_else(|| { + "Windows require being named in your config." + })? + .to_string(), + ), + root.clone(), + ) + .into(), + ); + + let target = + WindowTarget::new(Rc::clone(&project_name), k.as_str().unwrap()); commands.append(&mut common_commands(Target::WindowTarget(target.clone()))); // SendKeys for the exec command @@ -151,7 +158,8 @@ pub fn call<'a>( ); } - remains.push(SelectWindow::new(WindowTarget::new(Rc::clone(&project_name), &w.name)).into()); + remains + .push(SelectWindow::new(WindowTarget::new(Rc::clone(&project_name), &w.name)).into()); remains.push( SelectPane::new(PaneTarget::new( &project_name, diff --git a/load/tests/helpers/mod.rs b/load/tests/helpers/mod.rs index 05ee3b3..8e68016 100644 --- a/load/tests/helpers/mod.rs +++ b/load/tests/helpers/mod.rs @@ -75,11 +75,11 @@ fn open_muxed(project: &str, project_root: &Path) -> Result<(), String> { } fn kill_session(target: &str) { - let _ = load::tmux::call(&["kill-session", "-t", target]); + let _ = common::tmux::call(&["kill-session", "-t", target]); } fn send_keys(target: &str, exec: &str) { - let _ = load::tmux::call(&["send-keys", "-t", target, exec, "KPEnter"]); + let _ = common::tmux::call(&["send-keys", "-t", target, exec, "KPEnter"]); } fn wait_on(file: &PathBuf) { diff --git a/load/tests/load.rs b/load/tests/load.rs index 582e956..23899eb 100644 --- a/load/tests/load.rs +++ b/load/tests/load.rs @@ -4,7 +4,6 @@ extern crate common; extern crate snapshot; extern crate dirs; -extern crate libc; extern crate load; extern crate rand; extern crate yaml_rust; @@ -127,9 +126,13 @@ windows: let _ = fs::remove_dir(dir); // Use contains because OSX on travis ci symlinks /tmp/ to /private/tmp/ // resulting in `pane_current_path` being `/private/tmp/Direct…` - assert!(pane.path.to_str().unwrap().contains("/tmp/Directory With Spaces")); + assert!(pane + .path + .to_str() + .unwrap() + .contains("/tmp/Directory With Spaces")); } - + #[test] fn expect_home_var_to_open_in_home_dir() { let contents = b"---