diff --git a/CHANGELOG.md b/CHANGELOG.md index bb7e31257..423026265 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,6 +92,7 @@ Categories Used: - Update dependencies [\#257](https://github.com/ouch-org/ouch/pull/257) ([Artturin](https://github.com/Artturin)) - Add pull request template [\#263](https://github.com/ouch-org/ouch/pull/263) ([figsoda](https://github.com/figsoda)) - Clean up the description for the `-d/--dir` argument to `decompress` [\#264](https://github.com/ouch-org/ouch/pull/264) ([hivehand](https://github.com/hivehand)) +- Update dependencies [\#276](https://github.com/ouch-org/ouch/pull/276) ([figsoda](https://github.com/figsoda)) ### New Contributors diff --git a/Cargo.lock b/Cargo.lock index f7d46e8f3..4e893c68f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,9 +135,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.0.9" +version = "4.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30607dd93c420c6f1f80b544be522a0238a7db35e6a12968d28910983fee0df0" +checksum = "69d64e88428747154bd8bc378d178377ef4dace7a5735ca1f3855be72f2c2cb5" dependencies = [ "atty", "bitflags", @@ -159,9 +159,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.9" +version = "4.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a307492e1a34939f79d3b6b9650bd2b971513cd775436bf2b78defeb5af00b" +checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" dependencies = [ "heck", "proc-macro-error", @@ -199,6 +199,7 @@ dependencies = [ "lazy_static", "libc", "terminal_size", + "unicode-width", "winapi", ] @@ -347,14 +348,13 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.16.2" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +checksum = "bfddc9561e8baf264e0e45e197fd7696320026eb10a8180340debc27b18f535b" dependencies = [ "console", - "lazy_static", "number_prefix", - "regex", + "unicode-width", ] [[package]] @@ -410,9 +410,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.134" +version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] name = "libz-sys" @@ -827,9 +827,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.101" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" dependencies = [ "proc-macro2", "quote", @@ -909,9 +909,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b" +checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" dependencies = [ "libc", "num_threads", @@ -919,15 +919,21 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.4" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-width" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "uuid" -version = "1.1.2" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" [[package]] name = "vcpkg" diff --git a/Cargo.toml b/Cargo.toml index 629ba6dfa..b7928597c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,10 +15,10 @@ description = "A command-line utility for easily compressing and decompressing f [dependencies] atty = "0.2.14" bzip2 = "0.4.3" -clap = { version = "4.0.9", features = ["derive", "env"] } +clap = { version = "4.0.13", features = ["derive", "env"] } flate2 = { version = "1.0.24", default-features = false } fs-err = "2.8.1" -libc = "0.2.134" +libc = "0.2.135" linked-hash-map = "0.5.6" lzzzz = "1.0.3" once_cell = "1.15.0" @@ -29,16 +29,16 @@ zip = { version = "0.6.2", default-features = false } zstd = { version = "0.11.2", default-features = false } tempfile = "3.3.0" ignore = "0.4.18" -indicatif = "0.16.2" +indicatif = "0.17.1" [target.'cfg(unix)'.dependencies] -time = { version = "0.3.14", default-features = false } +time = { version = "0.3.15", default-features = false } [target.'cfg(not(unix))'.dependencies] is_executable = "1.0.1" [build-dependencies] -clap = { version = "4.0.9", features = ["derive", "env", "string"] } +clap = { version = "4.0.13", features = ["derive", "env", "string"] } clap_complete = "4.0.2" clap_mangen = "0.2.2" diff --git a/src/error.rs b/src/error.rs index 8002d3e03..7d3fddf19 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,10 +7,12 @@ use std::{ fmt::{self, Display}, }; +use indicatif::style::TemplateError; + use crate::{accessible::is_running_in_accessible_mode, utils::colors::*}; /// All errors that can be generated by `ouch` -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug)] pub enum Error { /// Not every IoError, some of them get filtered by `From` into other variants IoError { reason: String }, @@ -30,6 +32,8 @@ pub enum Error { CompressingRootFolder, /// Specialized walkdir's io::Error wrapper with additional information on the error WalkdirError { reason: String }, + /// TemplateError from + TemplateError(TemplateError), /// Custom and unique errors are reported in this variant Custom { reason: FinalError }, } @@ -135,6 +139,9 @@ impl fmt::Display for Error { FinalError::with_title(error_title.to_string()).detail("Permission denied") } Error::UnsupportedZipArchive(reason) => FinalError::with_title("Unsupported zip archive").detail(*reason), + Error::TemplateError(reason) => { + FinalError::with_title(reason.to_string()).detail("Progress bar template error") + } Error::Custom { reason } => reason.clone(), }; diff --git a/src/list.rs b/src/list.rs index 2f2cf93fd..1bce0dc3b 100644 --- a/src/list.rs +++ b/src/list.rs @@ -36,9 +36,8 @@ pub fn list_files( if list_options.tree { let pb = if !is_running_in_accessible_mode() { let template = "{wide_msg} [{elapsed_precise}] {spinner:.green}"; - let pb = ProgressBar::new_spinner(); - pb.set_style(ProgressStyle::default_bar().template(template)); - Some(pb) + let style = ProgressStyle::with_template(template).map_err(crate::Error::TemplateError)?; + Some(ProgressBar::new_spinner().with_style(style)) } else { None }; diff --git a/src/progress.rs b/src/progress.rs index 5b318c9c1..7ec368300 100644 --- a/src/progress.rs +++ b/src/progress.rs @@ -82,8 +82,8 @@ impl Progress { t += "({bytes_per_sec}, {eta}) {path}"; t }; - let bar = ProgressBar::new(total_input_size); - bar.set_style(ProgressStyle::default_bar().template(&template).progress_chars("#>-")); + let bar = ProgressBar::new(total_input_size) + .with_style(ProgressStyle::with_template(&template).unwrap().progress_chars("#>-")); while draw_rx.try_recv().is_err() { if let Some(ref pos_fn) = current_position_fn {