diff --git a/Cargo.lock b/Cargo.lock index 6c89bae..501c927 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.45" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" +checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203" [[package]] name = "arc-swap" @@ -291,40 +291,24 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.0-beta.5" +version = "3.0.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feff3878564edb93745d58cf63e17b63f24142506e7a20c87a5521ed7bfb1d63" +checksum = "967965e82fc46fee1a88147a7a977a66d615ed5f83eb95b18577b342c08f90ff" dependencies = [ "atty", "bitflags", - "clap_derive", "indexmap", - "lazy_static", "os_str_bytes", "strsim 0.10.0", "termcolor", "textwrap", - "unicase", -] - -[[package]] -name = "clap_derive" -version = "3.0.0-beta.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b15c6b4f786ffb6192ffe65a36855bc1fc2444bcd0945ae16748dcd6ed7d0d3" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", ] [[package]] name = "clap_generate" -version = "3.0.0-beta.5" +version = "3.0.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "097ab5db1c3417442270cd57c8dd39f6c3114d3ce09d595f9efddbb1fcfaa799" +checksum = "bdf3ee47de9ce0e5bfb686d0cf84eb9a2d4ee8e6fa78f97267ac0d37e060b9bd" dependencies = [ "clap", ] @@ -520,9 +504,9 @@ dependencies = [ [[package]] name = "dirs" -version = "3.0.2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ "dirs-sys", ] @@ -632,12 +616,13 @@ dependencies = [ [[package]] name = "fd-lock" -version = "2.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0010f02effd88c702318c5dde0463206be67495d0b4d906ba7c0a8f166cc7f06" +checksum = "a16910e685088843d53132b04e0f10a571fdb193224fc589685b3ba1ce4cb03d" dependencies = [ + "cfg-if", "libc", - "winapi", + "windows-sys", ] [[package]] @@ -648,9 +633,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" +checksum = "8cd0210d8c325c245ff06fd95a3b13689a1a276ac8cfa8e8720cb840bfb84b9e" dependencies = [ "futures-channel", "futures-core", @@ -663,9 +648,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" +checksum = "7fc8cd39e3dbf865f7340dce6a2d401d24fd37c6fe6c4f0ee0de8bfca2252d27" dependencies = [ "futures-core", "futures-sink", @@ -673,15 +658,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" +checksum = "629316e42fe7c2a0b9a65b47d159ceaa5453ab14e8f0a3c5eedbb8cd55b4a445" [[package]] name = "futures-executor" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" +checksum = "7b808bf53348a36cab739d7e04755909b9fcaaa69b7d7e588b37b6ec62704c97" dependencies = [ "futures-core", "futures-task", @@ -690,9 +675,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" +checksum = "e481354db6b5c353246ccf6a728b0c5511d752c08da7260546fc0933869daa11" [[package]] name = "futures-lite" @@ -711,12 +696,10 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" +checksum = "a89f17b21645bc4ed773c69af9c9a0effd4a3f1a3876eadd453469f8854e7fdd" dependencies = [ - "autocfg", - "proc-macro-hack", "proc-macro2", "quote", "syn", @@ -724,15 +707,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" +checksum = "996c6442437b62d21a32cd9906f9c41e7dc1e19a9579843fad948696769305af" [[package]] name = "futures-task" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" +checksum = "dabf1872aaab32c886832f2276d2f5399887e2bd613698a02359e4ea83f8de12" [[package]] name = "futures-timer" @@ -742,11 +725,10 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" +checksum = "41d22213122356472061ac0f1ab2cee28d2bac8491410fd68c2af53d1cedb83e" dependencies = [ - "autocfg", "futures-channel", "futures-core", "futures-io", @@ -756,8 +738,6 @@ dependencies = [ "memchr", "pin-project-lite", "pin-utils", - "proc-macro-hack", - "proc-macro-nested", "slab", ] @@ -797,15 +777,6 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "hermit-abi" version = "0.1.19" @@ -848,9 +819,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] @@ -956,6 +927,15 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1005,14 +985,15 @@ dependencies = [ [[package]] name = "nix" -version = "0.20.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" +checksum = "f305c2c2e4c39a82f7bf0bf65fb557f9070ce06781d4f2454295cc34b1c43188" dependencies = [ "bitflags", "cc", "cfg-if", "libc", + "memoffset", ] [[package]] @@ -1090,9 +1071,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "4.2.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addaa943333a514159c80c97ff4a93306530d965d27e139188283cd13e06a799" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" dependencies = [ "memchr", ] @@ -1159,42 +1140,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" - [[package]] name = "proc-macro2" version = "1.0.32" @@ -1313,9 +1258,9 @@ checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustyline" -version = "8.2.0" +version = "9.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd4eaf7a7738f76c98e4f0395253ae853be3eb018f7b0bb57fe1b6c17e31874" +checksum = "6c38cfbd0a4d7df7aab7cf53732d5d43449d0300358fd15cd4e8c8468a956aca" dependencies = [ "bitflags", "cfg-if", @@ -1349,9 +1294,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.130" +version = "1.0.131" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "b4ad69dfbd3e45369132cc64e6748c2d65cdfb001a2b1c232d128b4ad60561c1" dependencies = [ "serde_derive", ] @@ -1368,9 +1313,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.131" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "b710a83c4e0dff6a3d511946b95274ad9ca9e5d3ae497b63fda866ac955358d2" dependencies = [ "proc-macro2", "quote", @@ -1379,9 +1324,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.69" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e466864e431129c7e0d3476b92f20458e5879919a0596c6472738d9fa2d342f8" +checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527" dependencies = [ "itoa", "ryu", @@ -1581,9 +1526,6 @@ name = "textwrap" version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" -dependencies = [ - "unicode-width", -] [[package]] name = "thiserror" @@ -1655,15 +1597,6 @@ dependencies = [ "unsafe-any", ] -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-segmentation" version = "1.8.0" @@ -1870,6 +1803,49 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82ca39602d5cbfa692c4b67e3bcbb2751477355141c1ed434c94da4186836ff6" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52695a41e536859d5308cc613b4a022261a274390b25bd29dfff4bf08505f3c2" + +[[package]] +name = "windows_i686_gnu" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f54725ac23affef038fecb177de6c9bf065787c2f432f79e3c373da92f3e1d8a" + +[[package]] +name = "windows_i686_msvc" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d5158a43cc43623c0729d1ad6647e62fa384a3d135fd15108d37c683461f64" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc31f409f565611535130cfe7ee8e6655d3fa99c1c61013981e491921b5ce954" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f2b8c7cbd3bfdddd9ab98769f9746a7fad1bca236554cd032b78d768bc0e89f" + [[package]] name = "yaml-rust" version = "0.4.5" diff --git a/Cargo.toml b/Cargo.toml index dd88dc1..03bff6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,34 +18,34 @@ default = ["crossterm-backend"] crossterm-backend = ["tui/crossterm", "crossterm"] [dependencies] -anyhow = "1.0.43" -async-std = { version = "1.9.0", features = ["attributes", "unstable"] } +anyhow = "1.0.51" +async-std = { version = "1.10.0", features = ["attributes", "unstable"] } better-panic = "0.2.0" cassowary = "0.3.0" chrono = "0.4.19" -clap = "3.0.0-beta.4" +clap = "3.0.0-rc.4" crossterm = { version = "0.22.1", optional = true, default-features = false, features = ["event-stream"] } -dirs = "3.0.2" -futures = "0.3.16" +dirs = "4.0.0" +futures = "0.3.18" futures-timer = "3.0.2" -itertools = "0.10.1" +itertools = "0.10.3" lazy_static = "1.4.0" log = "0.4.14" log4rs = "1.0.0" rand = "0.8.4" regex = "1.5.4" -rustyline = "8.2" -serde = { version = "1.0.127", features = ["derive"] } -serde_json = "1.0.66" +rustyline = "9.1.1" +serde = { version = "1.0.131", features = ["derive"] } +serde_json = "1.0.72" shellexpand = "2.1.0" -shlex = "1.0.0" +shlex = "1.1.0" task-hookrs = { git = "https://github.com/kdheepak/task-hookrs" } tui = { version = "0.16.0", optional = true, default-features = false } unicode-segmentation = "1.8.0" unicode-truncate = "0.2.0" -unicode-width = "0.1.8" +unicode-width = "0.1.9" uuid = { version = "0.8.2", features = ["serde", "v4"] } -versions = "3" +versions = "3.0.3" [package.metadata.rpm] package = "taskwarrior-tui" @@ -62,6 +62,6 @@ incremental = true lto = "off" [build-dependencies] -clap = "3.0.0-beta.4" -clap_generate = "3.0.0-beta.4" -shlex = "1.0.0" +clap = "3.0.0-rc.4" +clap_generate = "3.0.0-rc.4" +shlex = "1.1.0" diff --git a/completions/taskwarrior-tui.bash b/completions/taskwarrior-tui.bash index 8c86351..984059b 100644 --- a/completions/taskwarrior-tui.bash +++ b/completions/taskwarrior-tui.bash @@ -9,7 +9,7 @@ _taskwarrior-tui() { for i in ${COMP_WORDS[@]} do case "${i}" in - taskwarrior-tui) + "$1") cmd="taskwarrior__tui" ;; *) diff --git a/docs/taskwarrior-tui.1 b/docs/taskwarrior-tui.1 index e792d38..5c8b40b 100644 --- a/docs/taskwarrior-tui.1 +++ b/docs/taskwarrior-tui.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 2.16.1 +.\" Automatically generated by Pandoc 2.16.2 .\" .TH "taskwarrior-tui" "1" "" "" "" .hy diff --git a/src/app.rs b/src/app.rs index 074c358..c4f092d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -53,7 +53,7 @@ use tui::{ widgets::{Block, BorderType, Borders, Clear, List, ListItem, Paragraph, Wrap}, }; -use rustyline::history::Direction as HistoryDirection; +use rustyline::history::SearchDirection as HistoryDirection; use rustyline::line_buffer::LineBuffer; use rustyline::At; use rustyline::Editor; diff --git a/src/cli.rs b/src/cli.rs index 8a0eef7..9a7b498 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -13,7 +13,7 @@ pub fn generate_cli_app() -> App<'static> { .short('c') .long("config") .value_name("FILE") - .about("Sets a custom config file") + .help("Sets a custom config file") .takes_value(true), ) .arg( @@ -21,7 +21,7 @@ pub fn generate_cli_app() -> App<'static> { .short('r') .long("report") .value_name("STRING") - .about("Sets default report") + .help("Sets default report") .takes_value(true), ); diff --git a/src/history.rs b/src/history.rs index eb71769..9c48192 100644 --- a/src/history.rs +++ b/src/history.rs @@ -1,7 +1,7 @@ use anyhow::{anyhow, Result}; use rustyline::error::ReadlineError; -use rustyline::history::Direction; use rustyline::history::History; +use rustyline::history::SearchDirection; use std::fs::File; use std::path::{Path, PathBuf}; @@ -59,7 +59,7 @@ impl HistoryContext { self.history_index } - pub fn history_search(&mut self, buf: &str, dir: Direction) -> Option { + pub fn history_search(&mut self, buf: &str, dir: SearchDirection) -> Option { log::debug!( "Searching history for {:?} in direction {:?} with history index = {:?} and history len = {:?}", buf, @@ -76,22 +76,22 @@ impl HistoryContext { let history_index = if self.history_index().is_none() { log::debug!("History index is none"); match dir { - Direction::Forward => return None, - Direction::Reverse => self.history_index = Some(self.history_len().saturating_sub(1)), + SearchDirection::Forward => return None, + SearchDirection::Reverse => self.history_index = Some(self.history_len().saturating_sub(1)), } self.history_index.unwrap() } else { let hi = self.history_index().unwrap(); - if hi == self.history.len().saturating_sub(1) && dir == Direction::Forward - || hi == 0 && dir == Direction::Reverse + if hi == self.history.len().saturating_sub(1) && dir == SearchDirection::Forward + || hi == 0 && dir == SearchDirection::Reverse { return None; } match dir { - Direction::Reverse => hi.saturating_sub(1), - Direction::Forward => hi.saturating_add(1).min(self.history_len().saturating_sub(1)), + SearchDirection::Reverse => hi.saturating_sub(1), + SearchDirection::Forward => hi.saturating_add(1).min(self.history_len().saturating_sub(1)), } }; @@ -99,8 +99,8 @@ impl HistoryContext { return if let Some(history_index) = self.history.starts_with(buf, history_index, dir) { log::debug!("Found index {:?}", history_index); log::debug!("Previous index {:?}", self.history_index); - self.history_index = Some(history_index); - self.history.get(history_index).cloned() + self.history_index = Some(history_index.idx); + Some(history_index.entry.to_string()) } else if buf.is_empty() { self.history_index = Some(history_index); self.history.get(history_index).cloned()