Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package hoard for openSUSE:Factory checked in at 2023-02-11 21:57:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hoard (Old) and /work/SRC/openSUSE:Factory/.hoard.new.1848 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hoard" Sat Feb 11 21:57:53 2023 rev:3 rq:1064380 version:1.3.1~0 Changes: -------- --- /work/SRC/openSUSE:Factory/hoard/hoard.changes 2022-12-22 16:22:47.837933880 +0100 +++ /work/SRC/openSUSE:Factory/.hoard.new.1848/hoard.changes 2023-02-11 21:58:20.532003111 +0100 @@ -1,0 +2,10 @@ +Sat Feb 11 10:23:27 UTC 2023 - Michael Vetter <mvet...@suse.com> + +- Update to 1.3.1: + * Fix bug, where hoard pick would not properly replace named + parameterized commands + * Tab highlight now also uses customizable color from config file + * Added update checker on startup, to notify the user about a + new version + +------------------------------------------------------------------- Old: ---- hoard-1.3.0~0.tar.xz New: ---- hoard-1.3.1~0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hoard.spec ++++++ --- /var/tmp/diff_new_pack.PsLf6H/_old 2023-02-11 21:58:22.988018402 +0100 +++ /var/tmp/diff_new_pack.PsLf6H/_new 2023-02-11 21:58:23.000018477 +0100 @@ -1,7 +1,7 @@ # # spec file for package hoard # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: hoard -Version: 1.3.0~0 +Version: 1.3.1~0 Release: 0 Summary: CLI command organizer License: MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.PsLf6H/_old 2023-02-11 21:58:23.040018725 +0100 +++ /var/tmp/diff_new_pack.PsLf6H/_new 2023-02-11 21:58:23.048018775 +0100 @@ -3,7 +3,7 @@ <param name="url">https://github.com/Hyde46/hoard.git</param> <param name="versionformat">@PARENT_TAG@~@TAG_OFFSET@</param> <param name="scm">git</param> - <param name="revision">v1.3.0</param> + <param name="revision">v1.3.1</param> <param name="match-tag">*</param> <param name="versionrewrite-pattern">v(\d+\.\d+\.\d+)</param> <param name="versionrewrite-replacement">\1</param> ++++++ hoard-1.3.0~0.tar.xz -> hoard-1.3.1~0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/CHANGES.md new/hoard-1.3.1~0/CHANGES.md --- old/hoard-1.3.0~0/CHANGES.md 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/CHANGES.md 2023-02-10 23:07:11.000000000 +0100 @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 1.3.1 +- ð Fix bug, where `hoard pick` would not properly replace named parameterized commands ## 1.3 - ⨠Inline command editing in the GUI. Press `<TAB>` to get started. Only editing the command, its description and the tags are supported for now - ⨠Inline command deletion in the GUI. Press `<Ctrl-X>` to delete a command in the GUI view @@ -12,7 +14,7 @@ ## 1.1.1 - ⨠Fully named parameters. When saving a parameter, you can now end the parameter name with `!`. This enables you to use spaces in the parameter name. Additionally, using the ending token `!` enables you to use a named parameter in a command where no space is between the parameter token and the rest of the command (Set a different token in your config) - ⨠Add filtered commands outpout `hoard list --json --filter <query_string>` to enable easier downstream usage -- ð¿ Temporarly disabled windows support. Switching the TUI backend to crossterm from termion broke zsh support on MacOS, which is deemed more important until a fix is prepared. +- ð¿ Temporarily disabled windows support. Switching the TUI backend to crossterm from termion broke zsh support on MacOS, which is deemed more important until a fix is prepared. ## 1.1.0 - ⨠Named Parameters. You can now add any string after your token `#`. Tokens with the same name will be filled out automatically after being prompted once for them when selecting a command from `hoard list` ## 1.0.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/Cargo.lock new/hoard-1.3.1~0/Cargo.lock --- old/hoard-1.3.0~0/Cargo.lock 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/Cargo.lock 2023-02-10 23:07:11.000000000 +0100 @@ -3,6 +3,15 @@ version = 3 [[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] name = "anyhow" version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -38,6 +47,12 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -87,23 +102,25 @@ [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "serde", "time 0.1.43", + "wasm-bindgen", "winapi", ] [[package]] name = "clap" -version = "4.0.29" +version = "4.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" +checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" dependencies = [ "bitflags", "clap_derive", @@ -116,9 +133,9 @@ [[package]] name = "clap_derive" -version = "4.0.21" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" dependencies = [ "heck", "proc-macro-error", @@ -137,6 +154,16 @@ ] [[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] name = "colored" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -149,16 +176,15 @@ [[package]] name = "console" -version = "0.15.2" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" +checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" dependencies = [ "encode_unicode 0.3.6", "lazy_static", "libc", - "terminal_size", "unicode-width", - "winapi", + "windows-sys 0.42.0", ] [[package]] @@ -245,12 +271,57 @@ ] [[package]] +name = "cxx" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "dialoguer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92e7e37ecef6857fdc0c0c5d42fd5b0938e46590c2183cc92dd310a6d078eb1" +checksum = "af3c796f3b0b408d9fd581611b47fa850821fcb84aa640b83a3c1a5be2d691f2" dependencies = [ "console", + "shell-words", "tempfile", "zeroize", ] @@ -517,11 +588,11 @@ [[package]] name = "hoard-rs" -version = "1.3.0" +version = "1.3.1" dependencies = [ "anyhow", "array_tool", - "base64", + "base64 0.21.0", "chrono", "clap", "console", @@ -539,7 +610,7 @@ "serde_yaml", "simple_logger", "tempfile", - "termion", + "termion 2.0.1", "thiserror", "tokio", "tui", @@ -618,6 +689,30 @@ ] [[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] name = "idna" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -714,6 +809,15 @@ checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + +[[package]] name = "linked-hash-map" version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -942,13 +1046,13 @@ [[package]] name = "prettytable-rs" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f375cb74c23b51d23937ffdeb48b1fbf5b6409d4b9979c1418c1de58bc8f801" +checksum = "eea25e07510aa6ab6547308ebe3c036016d162b8da920dbb079e3ba8acf3d95a" dependencies = [ - "atty", "csv", "encode_unicode 1.0.0", + "is-terminal", "lazy_static", "term", "unicode-width", @@ -1072,11 +1176,11 @@ [[package]] name = "reqwest" -version = "0.11.12" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" dependencies = [ - "base64", + "base64 0.13.1", "bytes", "encoding_rs", "futures-core", @@ -1150,6 +1254,12 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] +name = "scratch" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" + +[[package]] name = "security-framework" version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1174,18 +1284,18 @@ [[package]] name = "serde" -version = "1.0.140" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.140" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -1194,9 +1304,9 @@ [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa 1.0.2", "ryu", @@ -1228,6 +1338,12 @@ ] [[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] name = "signal-hook" version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1259,15 +1375,15 @@ [[package]] name = "simple_logger" -version = "2.3.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48047e77b528151aaf841a10a9025f9459da80ba820e425ff7eb005708a76dc7" +checksum = "e190a521c2044948158666916d9e872cbb9984f755e9bb3b5b75a836205affcd" dependencies = [ "atty", "colored", "log", - "time 0.3.9", - "winapi", + "time 0.3.16", + "windows-sys 0.42.0", ] [[package]] @@ -1300,9 +1416,9 @@ [[package]] name = "syn" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -1344,20 +1460,22 @@ ] [[package]] -name = "terminal_size" -version = "0.1.17" +name = "termion" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e" dependencies = [ "libc", - "winapi", + "numtoa", + "redox_syscall", + "redox_termios", ] [[package]] name = "termion" -version = "1.5.6" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e" +checksum = "659c1f379f3408c7e5e84c7d0da6d93404e3800b6b9d063ba24436419302ec90" dependencies = [ "libc", "numtoa", @@ -1397,21 +1515,32 @@ [[package]] name = "time" -version = "0.3.9" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +checksum = "0fab5c8b9980850e06d92ddbe3ab839c062c801f3927c0fb8abd6fc8e918fbca" dependencies = [ "itoa 1.0.2", "libc", "num_threads", + "serde", + "time-core", "time-macros", ] [[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] name = "time-macros" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +checksum = "65bb801831d812c562ae7d2bfb531f26e66e4e1f6b17307ba4149c5064710e5b" +dependencies = [ + "time-core", +] [[package]] name = "tinyvec" @@ -1430,9 +1559,9 @@ [[package]] name = "tokio" -version = "1.21.2" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" dependencies = [ "autocfg", "bytes", @@ -1445,7 +1574,7 @@ "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys 0.42.0", ] [[package]] @@ -1536,7 +1665,7 @@ "bitflags", "cassowary", "crossterm", - "termion", + "termion 1.5.6", "unicode-segmentation", "unicode-width", ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/Cargo.toml new/hoard-1.3.1~0/Cargo.toml --- old/hoard-1.3.0~0/Cargo.toml 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/Cargo.toml 2023-02-10 23:07:11.000000000 +0100 @@ -1,6 +1,6 @@ [package] name = "hoard-rs" -version = "1.3.0" +version = "1.3.1" edition = "2021" readme = "README.md" license = "MIT" @@ -28,10 +28,10 @@ [dependencies] # Command line argument parser -clap = { version = "4.0.29", features = ["derive"] } +clap = { version = "4.1.4", features = ["derive"] } # pretty dialogues in terminal -dialoguer = "0.10.2" -termion = "1.5.6" +dialoguer = "0.10.3" +termion = "2.0.1" # Yaml support to save/load command pallettes serde = { version = "1.0", features = ["derive"] } serde_yaml = "0.8" @@ -40,20 +40,20 @@ dirs = "4.0.0" log = "0.4" eyre = "0.6" -simple_logger = "2.3.0" -prettytable-rs = "0.9.0" -tui = { version = "0.19.0", features = ["termion"]} +simple_logger = "4.0.0" +prettytable-rs = "0.10.0" +tui = { version = "0.19.0", features = ["termion"] } chrono = { version = "0.4", features = ["serde"] } rand = { version = "0.8.4", default-features = false, features = ["std"] } thiserror = "1.0" crossbeam-channel = "0.5.6" -tokio = { version = "1.21.2", features = ["full"] } +tokio = { version = "1.25.0", features = ["full"] } array_tool = "1.0.3" -reqwest = { version = "0.11.12", features = ["blocking"] } -url = {version="2.3.1"} -console = "0.15.2" +reqwest = { version = "0.11.13", features = ["blocking", "json"] } +url = { version = "2.3.1" } +console = "0.15.5" enum-iterator = "1.2.0" -base64 = "0.13.1" +base64 = "0.21.0" [dev-dependencies] tempfile = "3.3.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/README.md new/hoard-1.3.1~0/README.md --- old/hoard-1.3.0~0/README.md 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/README.md 2023-02-10 23:07:11.000000000 +0100 @@ -4,7 +4,7 @@ <p align="center"> <a href="https://github.com/Hyde46/hoard/actions/workflows/test.yml"> - <img src="https://img.shields.io/github/workflow/status/hyde46/hoard/Rust?style=flat-square" /> + <img src="https://img.shields.io/github/actions/workflow/status/hyde46/hoard/test.yml?style=flat-square" /> </a> <a href="https://crates.io/crates/hoard-rs" ><img @@ -81,6 +81,7 @@ Tested on: - Ubuntu +- Arch - EndeavourOS Install `hoard` by running @@ -92,18 +93,31 @@ If you are running `fish` shell ``` -LATEST_RELEASE=1.3.0 ./install.fish +LATEST_RELEASE=1.3.1 ./install.fish ``` -### Brew on MacOS +### AUR (Arch Linux) +``` +paru -S hoard +``` + +### Homebrew (macOS) ``` brew tap Hyde46/hoard brew install hoard ``` + +### MacPorts (macOS) +``` +sudo port install hoard-cli +``` + +More info [here](https://ports.macports.org/port/hoard-cli/) + ### Windows Best to install from source, good luck -### Install Shell plugin +## Autocomplete with Shell plugin Install `hoard` as a plugin to enable autocomplete. Depending on your shell, run one of the following commands. @@ -149,8 +163,8 @@ ``` echo "My name is #first and I live at #city. Did I tell you my name, #first?" ``` -When putting `#first` you only have to do it once for each occurence in the command. -A parameter name is defined as everyting followed by the token until the first space character is found. +When putting `#first` you only have to do it once for each occurrence in the command. +A parameter name is defined as everything followed by the token until the first space character is found. Alternatively you can determine where the named parameter ends by putting a `!` ( Or your customized token from your `~/.config/hoard.config.yml`) ``` echo "My name is #first named parameter! and I live at #city. Did I tell you my name, #first?" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/example_troves/git.yml new/hoard-1.3.1~0/example_troves/git.yml --- old/hoard-1.3.0~0/example_troves/git.yml 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/example_troves/git.yml 2023-02-10 23:07:11.000000000 +0100 @@ -1,5 +1,5 @@ --- -version: 1.3.0 +version: 1.3.1 commands: - name: git_status namespace: git diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/install.fish new/hoard-1.3.1~0/install.fish --- old/hoard-1.3.0~0/install.fish 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/install.fish 2023-02-10 23:07:11.000000000 +0100 @@ -75,7 +75,7 @@ while true echo "How do you wish to install hoard?" echo "(1) From Source with cargo" - echo "(2) OS-Specifc" + echo "(2) OS-Specific" echo "(3) Not at all, bye" read -l -P '> ' confirm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/install.sh new/hoard-1.3.1~0/install.sh --- old/hoard-1.3.0~0/install.sh 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/install.sh 2023-02-10 23:07:11.000000000 +0100 @@ -27,7 +27,7 @@ echo "cargo not found" if command -v rustup &> /dev/null then - echo "rustup was found, but cargo wasn't. Something is up with your installtion" + echo "rustup was found, but cargo wasn't. Something is up with your installation" exit 1 fi @@ -71,14 +71,14 @@ } PS3='How do you wish to install hoard: ' -foods=("From Source with cargo" "OS-Specifc" "Not at all, bye") +foods=("From Source with cargo" "OS-Specific" "Not at all, bye") select fav in "${foods[@]}"; do case $fav in "From Source with cargo") __hoard_install_with_cargo break ;; - "OS-Specifc") + "OS-Specific") __hoard_detect_os break ;; @@ -91,6 +91,6 @@ done # TODO: Properly check which shell is installed -echo 'hoard shell_config zsh | source' >> ~/.zshrc -echo 'hoard shell_config bash | source' >> ~/.zshrc +echo 'hoard shell-config --shell zsh | source' >> ~/.zshrc +echo 'hoard shell-config --shell bash | source' >> ~/.bashrc echo 'source your .bashrc/.zshrc and press <Ctrl-H> to get started with the interactive hoard UI' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/src/command/hoard_command.rs new/hoard-1.3.1~0/src/command/hoard_command.rs --- old/hoard-1.3.0~0/src/command/hoard_command.rs 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/src/command/hoard_command.rs 2023-02-10 23:07:11.000000000 +0100 @@ -110,13 +110,13 @@ pub fn with_tags_input(self, default_value: Option<String>) -> Self { let tag_validator = move |input: &String| -> Result<(), String> { if input.contains(' ') { - Err("Tags cant contain whitespaces".to_string()) + Err("Tags can't contain whitespaces".to_string()) } else { Ok(()) } }; let tags: String = prompt_input_validate( - "Give your command some optional tags ( comma seperated )", + "Give your command some optional tags ( comma separated )", true, default_value, Some(tag_validator), @@ -145,7 +145,7 @@ let command_names = trove.commands.clone(); let validator = move |input: &String| -> Result<(), String> { if input.contains(' ') { - Err("The name cant contain whitespaces".to_string()) + Err("The name can't contain whitespaces".to_string()) } else if command_names .iter() .filter(|x| x.namespace == namespace) @@ -179,7 +179,7 @@ trove: &CommandTrove, ) -> (Option<Self>, Option<Self>) { // Behaviour if a command should be added to a trove file - // Returns a touple of options + // Returns a tuple of options // If the first is set, add this as a new command // If the second is set, remove this exact command let name = self.name.clone(); @@ -247,9 +247,9 @@ fn get_split_subject(&self, token: &str) -> Vec<String>; // Replaces parameter tokens with content from `parameters`, // consuming entries one by one until `parameters` is empty. - fn replace_parameter(self, token: &str, ending_token: &str, parameter: String) -> HoardCommand; + fn replace_parameter(&self, token: &str, ending_token: &str, parameter: String) -> HoardCommand; - fn with_input_parameters(self, token: &str) -> HoardCommand; + fn with_input_parameters(&mut self, token: &str, ending_token: &str) -> HoardCommand; } impl Parameterized for HoardCommand { @@ -272,7 +272,7 @@ collected } - fn replace_parameter(self, token: &str, ending_token: &str, parameter: String) -> HoardCommand { + fn replace_parameter(&self, token: &str, ending_token: &str, parameter: String) -> HoardCommand { let parameter_array = &[parameter.clone()]; let mut parameter_iter = parameter_array.iter(); @@ -281,7 +281,7 @@ // Named parameter ending with ending token. If ending token is not used, `full_named_token` is an empty string let mut full_named_token = string_find_next(&self.command, token, ending_token); full_named_token.push_str(ending_token); - // Select the split based on wether the ending token is part of the command or not + // Select the split based on whether the ending token is part of the command or not let split_token = if self.command.contains(ending_token) { full_named_token } else { @@ -292,8 +292,8 @@ for s in split { collected.push(s.clone()); - // if token is not named replace following occurences of the token in the command with the token again. - // only replace all occurences of a token if it is names + // if token is not named replace following occurrences of the token in the command with the token again. + // only replace all occurrences of a token if it is names // this is a convoluted way of achieving this, but doing it properly would need this method to be completely reworked let to_push = if split_token == token { token.to_string() @@ -302,41 +302,32 @@ }; collected.push(parameter_iter.next().unwrap_or(&to_push).clone()); } - // Always places either a token or the parmeter at the end, due to the bad loop design. + // Always places either a token or the parameter at the end, due to the bad loop design. // Just remove it at the end collected.pop(); Self { - name: self.name, - namespace: self.namespace, - tags: self.tags, + name: self.name.clone(), + namespace: self.namespace.clone(), + tags: self.tags.clone(), command: collected.concat(), - description: self.description, + description: self.description.clone(), } } - fn with_input_parameters(self, token: &str) -> HoardCommand { - let parameter_count = self.get_parameter_count(token); - if parameter_count == 0 { - return self; - } - let mut command_state = self.command.clone(); - for i in 0..parameter_count { - let prompt_dialoge = format!( + fn with_input_parameters(&mut self, token: &str, ending_token: &str) -> Self{ + let mut param_count = 0; + while self.get_parameter_count(token) != 0 { + let prompt_dialog = format!( "Enter parameter({}) nr {} \n~> {}\n", token, - (i + 1), - command_state + (param_count + 1), + self.command ); - let parameter = prompt_input(&prompt_dialoge, false, None); - command_state = command_state.replacen(token, ¶meter, 1); - } - Self { - name: self.name, - namespace: self.namespace, - tags: self.tags, - command: command_state, - description: self.description, + let parameter = prompt_input(&prompt_dialog, false, None); + self.command = self.replace_parameter(token, ending_token, parameter).command; + param_count += 1; } + Self { name:self.name.clone(), namespace:self.namespace.clone(), tags: self.tags.clone(), command: self.command.clone(), description: self.description.clone() } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/src/command/trove.rs new/hoard-1.3.1~0/src/command/trove.rs --- old/hoard-1.3.0~0/src/command/trove.rs 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/src/command/trove.rs 2023-02-10 23:07:11.000000000 +0100 @@ -105,7 +105,7 @@ pub fn add_command(&mut self, new_command: HoardCommand) -> bool { // Add a command to local trove file. - // Returns dirty flag, wether something got added/changed or not + // Returns dirty flag, whether something got added/changed or not // Returns true if there were changes // Returns false if synced troved file was either empty or the exact same let (to_add, to_remove): (Option<HoardCommand>, Option<HoardCommand>) = @@ -170,7 +170,7 @@ |command| { let command = command .clone() - .with_input_parameters(&config.parameter_token.clone().unwrap()); + .with_input_parameters(&config.parameter_token.clone().unwrap(), &config.parameter_ending_token.clone().unwrap()); Ok(command) }, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/src/config.rs new/hoard-1.3.1~0/src/config.rs --- old/hoard-1.3.0~0/src/config.rs 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/src/config.rs 2023-02-10 23:07:11.000000000 +0100 @@ -177,7 +177,7 @@ ) -> Result<(), Error> { // Adds configuration fields and sets the values to their default value if they are missing. // Mostly for legacy configuration support when new configuration options are added - // If any of the defaults are loaded and set, save the hoard configration to disk + // If any of the defaults are loaded and set, save the hoard configuration to disk let is_config_dirty = if loaded_config.primary_color.is_none() { loaded_config.primary_color = Some(HoardConfig::default_colors(0)); true @@ -235,6 +235,32 @@ } } +#[derive(Deserialize, Debug)] +pub struct ClientResponse { + pub tag_name: String, +} + +pub async fn compare_with_latest_version() -> (bool, String) { + let client = reqwest::Client::builder() + .user_agent(env!("CARGO_PKG_NAME")) + .build() + .unwrap(); + if let Ok(client_response) = client + .get("https://api.github.com/repos/Hyde46/hoard/releases/latest") + .send() + .await + { + let tag_name = client_response + .json::<ClientResponse>() + .await + .ok() + .unwrap() + .tag_name; + return (VERSION == &tag_name[1..], tag_name); + } + (true, String::new()) +} + fn save_config(config_to_save: &HoardConfig, config_path: &Path) -> Result<(), Error> { let s = serde_yaml::to_string(&config_to_save)?; fs::write(config_path, s).expect("Unable to write config file"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/src/gui/commands_gui.rs new/hoard-1.3.1~0/src/gui/commands_gui.rs --- old/hoard-1.3.0~0/src/gui/commands_gui.rs 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/src/gui/commands_gui.rs 2023-02-10 23:07:11.000000000 +0100 @@ -14,7 +14,8 @@ use std::fmt; use std::io::stdout; use std::time::Duration; -use termion::{raw::IntoRawMode, screen::AlternateScreen}; +use termion::raw::IntoRawMode; +use termion::screen::IntoAlternateScreen; use tui::{backend::TermionBackend, widgets::ListState, Terminal}; pub struct State { @@ -150,7 +151,7 @@ app_state.namespace_tab_state.select(Some(0)); let stdout = stdout().into_raw_mode()?; - let stdout = AlternateScreen::from(stdout); + let stdout = stdout.into_alternate_screen().unwrap(); let backend = TermionBackend::new(stdout); let mut terminal = Terminal::new(backend)?; terminal.clear()?; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/src/gui/list_search/render.rs new/hoard-1.3.1~0/src/gui/list_search/render.rs --- old/hoard-1.3.0~0/src/gui/list_search/render.rs 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/src/gui/list_search/render.rs 2023-02-10 23:07:11.000000000 +0100 @@ -70,7 +70,11 @@ ))) .highlight_style( Style::default() - .fg(Color::Rgb(181, 118, 20)) + .fg(Color::Rgb( + config.secondary_color.unwrap().0, + config.secondary_color.unwrap().1, + config.secondary_color.unwrap().2, + )) .add_modifier(Modifier::UNDERLINED), ) .divider(Span::raw("|")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/src/gui/parameter_input/render.rs new/hoard-1.3.1~0/src/gui/parameter_input/render.rs --- old/hoard-1.3.0~0/src/gui/parameter_input/render.rs 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/src/gui/parameter_input/render.rs 2023-02-10 23:07:11.000000000 +0100 @@ -70,7 +70,7 @@ // Named parameter ending with ending token. If ending token is not used, `full_named_token` is an empty string let mut full_named_token = string_find_next(command_text, token, ending_token); full_named_token.push_str(ending_token); - // Select the split based on wether the ending token is part of the command or not + // Select the split based on whether the ending token is part of the command or not let split_token = if command_text.contains(ending_token) { full_named_token } else { @@ -92,7 +92,7 @@ }; command_spans.append(&mut spans); } else { - // if the next token to replaced is named, find all other occurences and paint them too + // if the next token to replaced is named, find all other occurrences and paint them too let mut spans = split_commands .iter() .map(|e| { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/src/hoard.rs new/hoard-1.3.1~0/src/hoard.rs --- old/hoard-1.3.0~0/src/hoard.rs 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/src/hoard.rs 2023-02-10 23:07:11.000000000 +0100 @@ -1,4 +1,5 @@ use crate::cli_commands::{Cli, Commands}; +use base64::engine::general_purpose; use clap::Parser; use log::info; use reqwest::{StatusCode, Url}; @@ -10,7 +11,7 @@ use crate::cli_commands::Mode; use crate::command::hoard_command::HoardCommand; use crate::command::trove::CommandTrove; -use crate::config::HoardConfig; +use crate::config::{compare_with_latest_version, HoardConfig}; use crate::config::{load_or_build_config, save_hoard_config_file, save_parameter_token}; use crate::filter::query_trove; use crate::gui::commands_gui; @@ -20,7 +21,7 @@ }; use crate::sync_models::TokenResponse; use crate::util::rem_first_and_last; -use base64::encode; +use base64::Engine as _; #[derive(Default, Debug)] pub struct Hoard { @@ -44,7 +45,12 @@ self } - pub fn start(&mut self) -> (String, bool) { + pub async fn start(&mut self) -> (String, bool) { + if !compare_with_latest_version().await.0 { + println!( + "A newer Version ({}) is available at https://github.com/Hyde46/hoard \nPlease update.", compare_with_latest_version().await.1 + ); + } let mut autocomplete_command = String::new(); let cli = Cli::parse(); @@ -413,7 +419,7 @@ }); } - fn regsiter_user(&mut self) { + fn register_user(&mut self) { println!("Registering account.."); let user_email = prompt_input("Email: ", false, None); let user_pw: String = prompt_password_repeat("Password: "); @@ -456,7 +462,7 @@ let response_text = body.text().unwrap(); let token = serde_yaml::from_str::<TokenResponse>(&response_text).unwrap(); let mut config = self.config.clone().unwrap(); - let b64_token = encode(token.token); + let b64_token = general_purpose::STANDARD.encode(token.token); config.api_token = Some(b64_token); save_hoard_config_file(&config, &config.clone().config_home_path.unwrap()).unwrap(); println!("Success!"); @@ -520,7 +526,7 @@ // Check if user is logged in // Else inform the user to run `hoard sync login` first and break match command { - Mode::Register => self.regsiter_user(), + Mode::Register => self.register_user(), Mode::Login => { if self.is_logged_in() { println!("You are already logged in."); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/src/main.rs new/hoard-1.3.1~0/src/main.rs --- old/hoard-1.3.0~0/src/main.rs 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/src/main.rs 2023-02-10 23:07:11.000000000 +0100 @@ -17,8 +17,13 @@ mod util; use hoard::Hoard; -fn main() { - let (command, is_autocomplete) = Hoard::default().with_config(None).load_trove().start(); +#[tokio::main] +async fn main() { + let (command, is_autocomplete) = Hoard::default() + .with_config(None) + .load_trove() + .start() + .await; if is_autocomplete { eprintln!("{}", command.trim()); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hoard-1.3.0~0/src/util.rs new/hoard-1.3.1~0/src/util.rs --- old/hoard-1.3.0~0/src/util.rs 2022-12-21 14:06:28.000000000 +0100 +++ new/hoard-1.3.1~0/src/util.rs 2023-02-10 23:07:11.000000000 +0100 @@ -20,7 +20,7 @@ } pub fn string_find_next(s: &str, from: &str, to: &str) -> String { - // Find substring of a string `s` from first occurence of `from` to first occurence of `to` after `from` was encountered + // Find substring of a string `s` from first occurrence of `from` to first occurrence of `to` after `from` was encountered // For example: // `s` = "Hello #my test" | `from` = "#" | `to` = " " // Returns "#my" ++++++ vendor.tar.xz ++++++ /work/SRC/openSUSE:Factory/hoard/vendor.tar.xz /work/SRC/openSUSE:Factory/.hoard.new.1848/vendor.tar.xz differ: char 26, line 1