diff --git a/Cargo.lock b/Cargo.lock index a29e3a6..ef320c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,385 +2,231 @@ # It is not intended for manual editing. [[package]] name = "ansi_term" -<<<<<<< HEAD -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "autocfg" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "backtrace" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "autocfg 0.1.1 (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.45 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -======= version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8", ] [[package]] name = "atty" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi", + "libc", + "winapi 0.3.8", ] [[package]] name = "backtrace" -version = "0.3.38" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4036b9bf40f3cf16aba72a3d65e8a520fc4bafcdc7079aea8f848c58c5b5536" dependencies = [ - "backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible + "backtrace-sys", + "cfg-if", + "libc", + "rustc-demangle", ] [[package]] name = "backtrace-sys" -<<<<<<< HEAD -version = "0.1.28" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" dependencies = [ - "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)", -======= -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible + "cc", + "libc", ] [[package]] name = "bitflags" -<<<<<<< HEAD -version = "0.7.0" -======= -version = "1.2.0" ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "cc" -<<<<<<< HEAD -version = "1.0.28" -======= -version = "1.0.45" ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" [[package]] name = "cfg-if" -<<<<<<< HEAD -version = "0.1.6" -======= version = "0.1.10" ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "clap" -<<<<<<< HEAD -version = "2.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term_size 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-segmentation 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", -======= version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" dependencies = [ - "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible + "ansi_term", + "atty", + "bitflags", + "strsim", + "textwrap", + "unicode-width", + "vec_map", ] [[package]] name = "error-chain" -<<<<<<< HEAD -version = "0.12.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" dependencies = [ - "backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", -======= -version = "0.12.1" + "backtrace", + "version_check", +] + +[[package]] +name = "hermit-abi" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" dependencies = [ - "backtrace 0.3.38 (registry+https://github.com/rust-lang/crates.io-index)", - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible + "libc", ] [[package]] name = "kernel32-sys" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8", + "winapi-build", ] [[package]] name = "libc" -<<<<<<< HEAD -version = "0.2.45" -======= -version = "0.2.62" ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible +version = "0.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" [[package]] name = "redox_syscall" -<<<<<<< HEAD -version = "0.1.16" -======= version = "0.1.56" ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" [[package]] name = "rm-improved" version = "0.12.0" dependencies = [ -<<<<<<< HEAD - "clap 2.20.1 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", -======= - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible - "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "clap", + "error-chain", + "time", + "walkdir", ] [[package]] name = "rustc-demangle" -<<<<<<< HEAD -version = "0.1.11" -======= version = "0.1.16" ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" [[package]] name = "same-file" -<<<<<<< HEAD -version = "0.1.2" -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.45 (registry+https://github.com/rust-lang/crates.io-index)", -======= version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys", + "winapi 0.2.8", ] [[package]] name = "strsim" -<<<<<<< HEAD -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "term_size" -version = "0.2.2" -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.45 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -======= version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible + "unicode-width", ] [[package]] name = "time" -<<<<<<< HEAD -version = "0.1.36" -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.45 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-segmentation" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicode-width" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "vec_map" -version = "0.6.0" -======= version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "redox_syscall", + "winapi 0.3.8", ] [[package]] name = "unicode-width" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" [[package]] name = "vec_map" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" [[package]] name = "version_check" -version = "0.1.5" ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" [[package]] name = "walkdir" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -<<<<<<< HEAD - "same-file 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -======= - "same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys", + "same-file", + "winapi 0.2.8", ] [[package]] name = "winapi" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" -<<<<<<< HEAD -version = "0.3.6" -======= version = "0.3.8" ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 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-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" 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" - -[metadata] -<<<<<<< HEAD -"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" -"checksum autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4e5f34df7a019573fb8bdc7e24a2bfebe51a2a1d6bfdbaeccedb3c41fc574727" -"checksum backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "b5b493b66e03090ebc4343eb02f94ff944e0cbc9ac6571491d170ba026741eb5" -"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" -"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" -"checksum cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4a8b715cb4597106ea87c7c84b2f1d452c7492033765df7f32651e66fcf749" -"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" -"checksum clap 2.20.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73ec15755425b87a9766c3ef47000c01aae155266f9a4c2f1ffc962ee612863e" -"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)" = "2d2857ec59fadc0773853c664d2d18e7198e83883e7060b63c924cb077bd5c74" -"checksum redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd35cc9a8bdec562c757e3d43c1526b5c6d2653e23e2315065bc25556550753" -"checksum rustc-demangle 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "01b90379b8664dd83460d59bdc5dd1fd3172b8913788db483ed1325171eab2f7" -"checksum same-file 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c722bde68d432ad7982a6431b13264cc558af1707c0f321820e238c5671856ea" -"checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" -"checksum term_size 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "71662702fe5cd2cf95edd4ad655eea42f24a87a0e44059cbaa4e55260b7bc331" -"checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade" -"checksum unicode-segmentation 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7baebdc1df1363fa66161fca2fe047e4f4209011cc7e045948298996afdf85df" -"checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" -"checksum vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac5efe5cb0fa14ec2f84f83c701c562ee63f6dcc680861b21d65c682adfb05f" -"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" -======= -"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum backtrace 0.3.38 (registry+https://github.com/rust-lang/crates.io-index)" = "690a62be8920ccf773ee00ef0968649b0e724cda8bd5b12286302b4ae955fdf5" -"checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b" -"checksum bitflags 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a606a02debe2813760609f57a64a2ffd27d9fdf5b2f133eaca0b248dd92cdd2" -"checksum cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)" = "4fc9a35e1f4290eb9e5fc54ba6cf40671ed2a2514c3eeb2b2a908dda2ea5a1be" -"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" -"checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" -"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" -"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" -"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" -"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" -"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" -"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" -"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" ->>>>>>> Use "$XDG_DATA_HOME/graveyard" if possible -"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-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/src/main.rs b/src/main.rs index 2a02389..d440718 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,15 +7,14 @@ extern crate error_chain; extern crate time; extern crate walkdir; -use clap::{Arg, App}; -use walkdir::WalkDir; -use std::{env, fs, io}; -use std::path::{Path, PathBuf}; -use std::io::{Read, Write, BufRead, BufReader}; +use clap::{App, Arg}; +use std::io::{BufRead, BufReader, Read, Write}; use std::os::unix::fs::{FileTypeExt, PermissionsExt}; -use std::borrow::Cow; +use std::path::{Path, PathBuf}; +use std::{env, fs, io}; +use walkdir::WalkDir; mod errors { - error_chain!{} + error_chain! {} } use errors::*; @@ -56,55 +55,67 @@ fn run() -> Result<()> { let matches = App::new("rip") .version(crate_version!()) .author(crate_authors!()) - .about("Rm ImProved -Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinking them.") - .arg(Arg::with_name("TARGET") - .help("File or directory to remove") - .multiple(true) - .index(1)) - .arg(Arg::with_name("graveyard") - .help("Directory where deleted files go to rest") - .long("graveyard") - .takes_value(true)) - .arg(Arg::with_name("decompose") - .help("Permanently deletes (unlink) the entire graveyard") - .short("d") - .long("decompose")) - .arg(Arg::with_name("seance") - .help("Prints files that were sent under the current directory") - .short("s") - .long("seance")) - .arg(Arg::with_name("unbury") - .help("Undo the last removal by the current user, or specify some file(s) in the \ - graveyard. Combine with -s to restore everything printed by -s.") - .short("u") - .long("unbury") - .value_name("target") - .min_values(0)) - .arg(Arg::with_name("inspect") - .help("Prints some info about TARGET before prompting for action") - .short("i") - .long("inspect")) + .about( + "Rm ImProved +Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinking them.", + ) + .arg( + Arg::with_name("TARGET") + .help("File or directory to remove") + .multiple(true) + .index(1), + ) + .arg( + Arg::with_name("graveyard") + .help("Directory where deleted files go to rest") + .long("graveyard") + .takes_value(true), + ) + .arg( + Arg::with_name("decompose") + .help("Permanently deletes (unlink) the entire graveyard") + .short("d") + .long("decompose"), + ) + .arg( + Arg::with_name("seance") + .help("Prints files that were sent under the current directory") + .short("s") + .long("seance"), + ) + .arg( + Arg::with_name("unbury") + .help( + "Undo the last removal by the current user, or specify some file(s) in the \ + graveyard. Combine with -s to restore everything printed by -s.", + ) + .short("u") + .long("unbury") + .value_name("target") + .min_values(0), + ) + .arg( + Arg::with_name("inspect") + .help("Prints some info about TARGET before prompting for action") + .short("i") + .long("inspect"), + ) .get_matches(); - let _graveyard_opts = { - (matches.value_of("graveyard"), - env::var("GRAVEYARD"), - env::var("XDG_DATA_HOME")) - }; - let _graveyard: Cow = match _graveyard_opts { - (Some(flag), _, _) => flag.into(), - (_, Ok(env), _) => env.into(), - (_, _, Ok(mut env)) => { + let graveyard: &PathBuf = &{ + if let Some(flag) = matches.value_of("graveyard") { + flag.to_owned() + } else if let Ok(env) = env::var("GRAVEYARD") { + env + } else if let Ok(mut env) = env::var("XDG_DATA_HOME") { if !env.ends_with(std::path::MAIN_SEPARATOR) { env.push(std::path::MAIN_SEPARATOR); } env.push_str("graveyard"); - env.into() - }, - _ => format!("{}-{}", GRAVEYARD, get_user()).into(), - }; - let graveyard = Path::new(&*_graveyard); + env + } else { + format!("{}-{}", GRAVEYARD, get_user()) + }}.into(); if matches.is_present("decompose") { if prompt_yes("Really unlink the entire graveyard?") { @@ -127,9 +138,7 @@ Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinki // the graves_to_exhume. if matches.is_present("seance") { if let Ok(f) = fs::File::open(record) { - let gravepath = join_absolute(graveyard, cwd) - .to_string_lossy() - .into_owned(); + let gravepath = join_absolute(graveyard, cwd).to_string_lossy().into_owned(); for grave in seance(f, gravepath) { graves_to_exhume.push(grave); } @@ -155,16 +164,19 @@ Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinki } }; bury(entry.dest, orig).chain_err(|| { - format!("Unbury failed: couldn't copy files from {} to {}", - entry.dest.display(), - orig.display()) - })?; + format!( + "Unbury failed: couldn't copy files from {} to {}", + entry.dest.display(), + orig.display() + ) + })?; println!("Returned {} to {}", entry.dest.display(), orig.display()); } // Reopen the record and then delete lines corresponding to exhumed graves if let Err(e) = fs::File::open(record) - .and_then(|f| delete_lines_from_record(f, record, graves_to_exhume)) { + .and_then(|f| delete_lines_from_record(f, record, graves_to_exhume)) + { bail!("Failed to remove unburied files from record: {}", e); } return Ok(()); @@ -185,7 +197,9 @@ Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinki if let Ok(metadata) = fs::symlink_metadata(target) { // Canonicalize the path unless it's a symlink let source = &if !metadata.file_type().is_symlink() { - cwd.join(target).canonicalize().chain_err(|| "Failed to canonicalize path")? + cwd.join(target) + .canonicalize() + .chain_err(|| "Failed to canonicalize path")? } else { cwd.join(target) }; @@ -193,14 +207,18 @@ Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinki if matches.is_present("inspect") { if metadata.is_dir() { // Get the size of the directory and all its contents - println!("{}: directory, {} including:", - target, - humanize_bytes(WalkDir::new(source) - .into_iter() - .filter_map(|x| x.ok()) - .filter_map(|x| x.metadata().ok()) - .map(|x| x.len()) - .sum::())); + println!( + "{}: directory, {} including:", + target, + humanize_bytes( + WalkDir::new(source) + .into_iter() + .filter_map(|x| x.ok()) + .filter_map(|x| x.metadata().ok()) + .map(|x| x.len()) + .sum::() + ) + ); // Print the first few top-level files in the directory for entry in WalkDir::new(source) @@ -208,7 +226,8 @@ Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinki .max_depth(1) .into_iter() .filter_map(|entry| entry.ok()) - .take(FILES_TO_INSPECT) { + .take(FILES_TO_INSPECT) + { println!("{}", entry.path().display()); } } else { @@ -218,7 +237,8 @@ Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinki for line in BufReader::new(f) .lines() .take(LINES_TO_INSPECT) - .filter_map(|line| line.ok()) { + .filter_map(|line| line.ok()) + { println!("> {}", line); } } else { @@ -255,8 +275,11 @@ Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinki } }; - bury(source, dest).or_else(|e| { - fs::remove_dir_all(dest).is_ok(); + bury(source, dest) + .or_else(|e| { + fs::remove_dir_all(dest).chain_err(|| { + format!("Failed to move {} to {}", source.display(), dest.display()) + })?; Err(e) }) .chain_err(|| "Failed to bury file")?; @@ -276,19 +299,23 @@ Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinki /// Write deletion history to record fn write_log(source: S, dest: D, record: R) -> io::Result<()> - where S: AsRef, - D: AsRef, - R: AsRef +where + S: AsRef, + D: AsRef, + R: AsRef, { let (source, dest) = (source.as_ref(), dest.as_ref()); - let mut f = fs::OpenOptions::new().create(true) + let mut f = fs::OpenOptions::new() + .create(true) .append(true) .open(record)?; - writeln!(f, - "{}\t{}\t{}", - time::now().ctime(), - source.display(), - dest.display())?; + writeln!( + f, + "{}\t{}\t{}", + time::now().ctime(), + source.display(), + dest.display() + )?; Ok(()) } @@ -305,35 +332,45 @@ fn bury, D: AsRef>(source: S, dest: D) -> Result<()> { let parent = dest.parent().ok_or("Couldn't get parent of dest")?; fs::create_dir_all(parent).chain_err(|| "Couldn't create parent dir")?; - if fs::symlink_metadata(source).chain_err(|| "Couldn't get metadata")?.is_dir() { + if fs::symlink_metadata(source) + .chain_err(|| "Couldn't get metadata")? + .is_dir() + { // Walk the source, creating directories and copying files as needed for entry in WalkDir::new(source).into_iter().filter_map(|e| e.ok()) { // Path without the top-level directory - let orphan: &Path = entry.path() + let orphan: &Path = entry + .path() .strip_prefix(source) .chain_err(|| "Parent directory isn't a prefix of child directories?")?; if entry.file_type().is_dir() { fs::create_dir_all(dest.join(orphan)).chain_err(|| { - format!("Failed to create {} in {}", - entry.path().display(), - dest.join(orphan).display()) - })?; + format!( + "Failed to create {} in {}", + entry.path().display(), + dest.join(orphan).display() + ) + })?; } else { copy_file(entry.path(), dest.join(orphan)).chain_err(|| { - format!("Failed to copy file from {} to {}", - entry.path().display(), - dest.join(orphan).display()) - })?; + format!( + "Failed to copy file from {} to {}", + entry.path().display(), + dest.join(orphan).display() + ) + })?; } } fs::remove_dir_all(source) .chain_err(|| format!("Failed to remove dir: {}", source.display()))?; } else { copy_file(source, dest).chain_err(|| { - format!("Failed to copy file from {} to {}", - source.display(), - dest.display()) - })?; + format!( + "Failed to copy file from {} to {}", + source.display(), + dest.display() + ) + })?; fs::remove_file(source) .chain_err(|| format!("Failed to remove file: {}", source.display()))?; } @@ -347,9 +384,11 @@ fn copy_file, D: AsRef>(source: S, dest: D) -> io::Result<( let filetype = metadata.file_type(); if metadata.len() > BIG_FILE_THRESHOLD { - println!("About to copy a big file ({} is {})", - source.display(), - humanize_bytes(metadata.len())); + println!( + "About to copy a big file ({} is {})", + source.display(), + humanize_bytes(metadata.len()) + ); if prompt_yes("Permanently delete this file instead?") { return Ok(()); } @@ -377,8 +416,10 @@ fn copy_file, D: AsRef>(source: S, dest: D) -> io::Result<( } // Create a dummy file to act as a marker in the graveyard let mut marker = fs::File::create(dest)?; - marker.write_all(b"This is a marker for a file that was \ - permanently deleted. Requiescat in pace.")?; + marker.write_all( + b"This is a marker for a file that was \ + permanently deleted. Requiescat in pace.", + )?; } Ok(()) @@ -445,10 +486,11 @@ fn seance>(f: fs::File, gravepath: T) -> impl Iterator>(f: fs::File, - record: R, - graves: &[PathBuf]) - -> io::Result<()> { +fn delete_lines_from_record>( + f: fs::File, + record: R, + graves: &[PathBuf], +) -> io::Result<()> { let record = record.as_ref(); // Get the lines to write back to the record, which is every line except // the ones matching the exhumed graves. Store them in a vector