From a18a41c967980ba832c36bf9d5c7955317734436 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Fri, 1 Sep 2023 20:30:36 -0700 Subject: [PATCH 1/2] revert: feat(args): update clap and clap extras to v4 (#137) This reverts commit 0e710c256b1bbb7e0ab9e4cd5e16e01bac037d42. This is to ensure that there is no GPL 3.0 code contributions left to address https://github.com/orhun/git-cliff/issues/165 --- Cargo.lock | 494 ++++++++++++++++--------------- git-cliff/Cargo.toml | 12 +- git-cliff/src/args.rs | 113 +++---- git-cliff/src/bin/completions.rs | 2 +- git-cliff/src/lib.rs | 2 +- 5 files changed, 305 insertions(+), 318 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd01f17fb3..f24a507d20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.0.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8f9420f797f2d9e935edf629310eb938a0d839f984e25327f3c7eed22300c" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -41,54 +41,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" - -[[package]] -name = "anstyle-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "anstyle-wincon" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" -dependencies = [ - "anstyle", - "windows-sys", -] - [[package]] name = "async-trait" version = "0.1.73" @@ -97,7 +49,18 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.37", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", ] [[package]] @@ -108,9 +71,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -123,9 +86,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "bitflags" @@ -150,9 +113,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" dependencies = [ "memchr", "serde", @@ -160,21 +123,21 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -188,14 +151,14 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "winapi", + "windows-targets", ] [[package]] @@ -222,70 +185,63 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.4" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ - "clap_builder", + "atty", + "bitflags 1.3.2", "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" -dependencies = [ - "anstream", - "anstyle", "clap_lex", + "indexmap 1.9.3", + "once_cell", "strsim", + "termcolor", "terminal_size", + "textwrap", ] [[package]] name = "clap_complete" -version = "4.4.1" +version = "3.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4110a1e6af615a9e6d0a36f805d5c99099f8bab9b8042f5bc1fa220a4a89e36f" +checksum = "3f7a2e0a962c45ce25afce14220bc24f9dade0a1787f185cecf96bfba7847cd8" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.4.2" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ "heck", + "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] [[package]] name = "clap_mangen" -version = "0.2.14" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b44f35c514163027542f7147797ff930523eea288e03642727348ef1a9666f6b" +checksum = "105180c05a72388d5f5e4e4f6c79eecb92497bda749fa8f963a16647c5d5377f" dependencies = [ "clap", "roff", ] -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - [[package]] name = "config" version = "0.13.3" @@ -416,9 +372,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -444,9 +400,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", @@ -465,9 +421,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "miniz_oxide", @@ -517,7 +473,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.37", ] [[package]] @@ -571,9 +527,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "git-cliff" @@ -672,9 +628,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -709,9 +665,18 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "http" @@ -870,6 +835,17 @@ dependencies = [ "hashbrown 0.14.0", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.3", + "libc", + "windows-sys", +] + [[package]] name = "ipnet" version = "2.8.0" @@ -882,8 +858,8 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi", - "rustix", + "hermit-abi 0.3.3", + "rustix 0.38.14", "windows-sys", ] @@ -931,7 +907,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn", + "syn 2.0.37", ] [[package]] @@ -942,9 +918,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libgit2-sys" @@ -984,9 +960,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] name = "log" @@ -1057,15 +1039,15 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.3", "libc", ] [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -1082,6 +1064,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "os_str_bytes" +version = "6.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" + [[package]] name = "parse-zoneinfo" version = "0.3.0" @@ -1105,19 +1093,20 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.2" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" +checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.2" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" +checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" dependencies = [ "pest", "pest_generator", @@ -1125,22 +1114,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.2" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" +checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn", + "syn 2.0.37", ] [[package]] name = "pest_meta" -version = "2.7.2" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" +checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" dependencies = [ "once_cell", "pest", @@ -1187,9 +1176,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1229,20 +1218,44 @@ dependencies = [ "log", ] +[[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 1.0.109", + "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-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1328,9 +1341,9 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ "base64", "bytes", @@ -1361,7 +1374,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.22.6", + "webpki-roots 0.25.2", "winreg", ] @@ -1406,7 +1419,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn", + "syn 2.0.37", "walkdir", ] @@ -1428,26 +1441,40 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.8" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys", +] + +[[package]] +name = "rustix" +version = "0.38.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.7", "windows-sys", ] [[package]] name = "rustls" -version = "0.21.6" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", - "rustls-webpki 0.101.3", + "rustls-webpki 0.101.6", "sct", ] @@ -1462,9 +1489,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.100.1" +version = "0.100.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" dependencies = [ "ring", "untrusted", @@ -1472,9 +1499,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.3" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ "ring", "untrusted", @@ -1507,9 +1534,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" [[package]] name = "serde" @@ -1528,7 +1555,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.37", ] [[package]] @@ -1595,15 +1622,15 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -1629,9 +1656,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys", @@ -1651,9 +1678,20 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "2.0.28" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -1684,23 +1722,32 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" dependencies = [ - "rustix", + "rustix 0.37.23", "windows-sys", ] +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +dependencies = [ + "terminal_size", +] + [[package]] name = "thiserror" version = "1.0.48" @@ -1718,15 +1765,16 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.37", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if", "once_cell", ] @@ -1747,9 +1795,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.31.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ "backtrace", "bytes", @@ -1757,7 +1805,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.3", + "socket2 0.5.4", "windows-sys", ] @@ -1773,9 +1821,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -1862,9 +1910,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -1924,9 +1972,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -1939,9 +1987,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -1983,7 +2031,7 @@ dependencies = [ "log", "once_cell", "rustls", - "rustls-webpki 0.100.1", + "rustls-webpki 0.100.3", "serde", "serde_json", "url", @@ -1992,21 +2040,15 @@ dependencies = [ [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - [[package]] name = "vcpkg" version = "0.2.15" @@ -2021,9 +2063,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -2065,7 +2107,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -2099,7 +2141,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2120,33 +2162,20 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" dependencies = [ - "webpki", + "rustls-webpki 0.100.3", ] [[package]] name = "webpki-roots" -version = "0.23.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki 0.100.1", -] +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] name = "winapi" @@ -2166,9 +2195,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -2199,9 +2228,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -2214,62 +2243,63 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.10" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5504cc7644f4b593cbc05c4a55bf9bd4e94b867c3c0bd440934174d50482427d" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys", ] [[package]] diff --git a/git-cliff/Cargo.toml b/git-cliff/Cargo.toml index b3cba50526..ebefd550c7 100644 --- a/git-cliff/Cargo.toml +++ b/git-cliff/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git-cliff" -version = "1.3.0" # managed by release.sh +version = "1.3.0" # managed by release.sh description = "A highly customizable changelog generator ⛰️" authors = ["git-cliff contributors "] license = "GPL-3.0" @@ -31,17 +31,17 @@ regex.workspace = true log.workspace = true pretty_env_logger = "0.5.0" dirs-next = "2.0.0" -clap_complete = "4.4.1" -clap_mangen = "0.2.14" +clap_complete = "3.2.5" +clap_mangen = "0.1.11" shellexpand = "3.1.0" [dependencies.git-cliff-core] -version = "1.3.0" # managed by release.sh +version = "1.3.0" # managed by release.sh path = "../git-cliff-core" [dependencies.clap] -version = "4.4.4" -features = ["derive", "env", "wrap_help", "cargo"] +version = "3.2.22" +features = ["derive", "env", "wrap_help"] [dependencies.update-informer] version = "1.1.0" diff --git a/git-cliff/src/args.rs b/git-cliff/src/args.rs index f534bffdf3..cfc4246315 100644 --- a/git-cliff/src/args.rs +++ b/git-cliff/src/args.rs @@ -1,20 +1,20 @@ use clap::{ - ArgAction, + AppSettings, + ArgEnum, Parser, - ValueEnum, }; use git_cliff_core::DEFAULT_CONFIG; use glob::Pattern; use std::path::PathBuf; -#[derive(Debug, Clone, Copy, ValueEnum)] +#[derive(Debug, Clone, Copy, ArgEnum)] pub enum Strip { Header, Footer, All, } -#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, ArgEnum)] pub enum Sort { Oldest, Newest, @@ -22,10 +22,11 @@ pub enum Sort { /// Command-line arguments to parse. #[derive(Debug, Parser)] -#[command( +#[clap( version, - author = clap::crate_authors!("\n"), + author, about, + global_setting = AppSettings::DeriveDisplayOrder, rename_all_env = "screaming-snake", help_template = "\ {before-help}{name} {version} @@ -36,105 +37,61 @@ pub enum Sort { {all-args}{after-help} ", override_usage = "git-cliff [FLAGS] [OPTIONS] [--] [RANGE]", - next_help_heading = Some("OPTIONS"), - disable_help_flag = true, - disable_version_flag = true, + mut_arg("help", |arg| arg.help("Prints help information").help_heading("FLAGS")), + mut_arg("version", |arg| arg.help("Prints version information").help_heading("FLAGS")) )] pub struct Opt { - #[arg( - short, - long, - action = ArgAction::Help, - global = true, - help = "Prints help information", - help_heading = "FLAGS" - )] - pub help: Option, - #[arg( - short = 'V', - long, - action = ArgAction::Version, - global = true, - help = "Prints version information", - help_heading = "FLAGS" - )] - pub version: Option, /// Increases the logging verbosity. - #[arg(short, long, action = ArgAction::Count, alias = "debug", help_heading = Some("FLAGS"))] + #[clap(short, long, parse(from_occurrences), alias = "debug", help_heading = Some("FLAGS"))] pub verbose: u8, /// Sets the configuration file. - #[arg( - short, - long, - env = "GIT_CLIFF_CONFIG", - value_name = "PATH", - default_value = DEFAULT_CONFIG, - value_parser = Opt::parse_dir - )] + #[clap(short, long, env = "GIT_CLIFF_CONFIG", value_name = "PATH", default_value = DEFAULT_CONFIG, value_parser = Opt::parse_dir)] pub config: PathBuf, /// Sets the working directory. - #[arg( - short, - long, - env = "GIT_CLIFF_WORKDIR", - value_name = "PATH", - value_parser = Opt::parse_dir - )] + #[clap(short, long, env = "GIT_CLIFF_WORKDIR", value_name = "PATH", value_parser = Opt::parse_dir)] pub workdir: Option, /// Sets the git repository. - #[arg( + #[clap( short, long, env = "GIT_CLIFF_REPOSITORY", value_name = "PATH", - num_args(1..), - value_parser = Opt::parse_dir + multiple_values = true, + value_parser = Opt::parse_dir, )] pub repository: Option>, /// Sets the path to include related commits. - #[arg( + #[clap( long, env = "GIT_CLIFF_INCLUDE_PATH", value_name = "PATTERN", - num_args(1..) + multiple_values = true )] pub include_path: Option>, /// Sets the path to exclude related commits. - #[arg( + #[clap( long, env = "GIT_CLIFF_EXCLUDE_PATH", value_name = "PATTERN", - num_args(1..) + multiple_values = true )] pub exclude_path: Option>, /// Sets custom commit messages to include in the changelog. - #[arg( + #[clap( long, env = "GIT_CLIFF_WITH_COMMIT", value_name = "MSG", - num_args(1..) + multiple_values = true )] pub with_commit: Option>, /// Prepends entries to the given changelog file. - #[arg( - short, - long, - env = "GIT_CLIFF_PREPEND", - value_name = "PATH", - value_parser = Opt::parse_dir - )] + #[clap(short, long, env = "GIT_CLIFF_PREPEND", value_name = "PATH", value_parser = Opt::parse_dir)] pub prepend: Option, /// Writes output to the given file. - #[arg( - short, - long, - env = "GIT_CLIFF_OUTPUT", - value_name = "PATH", - value_parser = Opt::parse_dir - )] + #[clap(short, long, env = "GIT_CLIFF_OUTPUT", value_name = "PATH", value_parser = Opt::parse_dir)] pub output: Option, /// Sets the tag for the latest version. - #[arg( + #[clap( short, long, env = "GIT_CLIFF_TAG", @@ -143,7 +100,7 @@ pub struct Opt { )] pub tag: Option, /// Sets the template for the changelog body. - #[arg( + #[clap( short, long, env = "GIT_CLIFF_TEMPLATE", @@ -152,35 +109,35 @@ pub struct Opt { )] pub body: Option, /// Writes the default configuration file to cliff.toml - #[arg(short, long, help_heading = Some("FLAGS"))] + #[clap(short, long, help_heading = Some("FLAGS"))] pub init: bool, /// Processes the commits starting from the latest tag. - #[arg(short, long, help_heading = Some("FLAGS"))] + #[clap(short, long, help_heading = Some("FLAGS"))] pub latest: bool, /// Processes the commits that belong to the current tag. - #[arg(long, help_heading = Some("FLAGS"))] + #[clap(long, help_heading = Some("FLAGS"))] pub current: bool, /// Processes the commits that do not belong to a tag. - #[arg(short, long, help_heading = Some("FLAGS"))] + #[clap(short, long, help_heading = Some("FLAGS"))] pub unreleased: bool, /// Sorts the tags topologically. - #[arg(long, help_heading = Some("FLAGS"))] + #[clap(long, help_heading = Some("FLAGS"))] pub topo_order: bool, /// Prints changelog context as JSON. - #[arg(long, help_heading = Some("FLAGS"))] + #[clap(long, help_heading = Some("FLAGS"))] pub context: bool, /// Strips the given parts from the changelog. - #[arg(short, long, value_name = "PART", value_enum)] + #[clap(short, long, value_name = "PART", arg_enum)] pub strip: Option, /// Sets sorting of the commits inside sections. - #[arg( + #[clap( long, - value_enum, + arg_enum, default_value_t = Sort::Oldest )] pub sort: Sort, /// Sets the commit range to process. - #[arg(value_name = "RANGE", help_heading = Some("ARGS"))] + #[clap(value_name = "RANGE", help_heading = Some("ARGS"))] pub range: Option, } diff --git a/git-cliff/src/bin/completions.rs b/git-cliff/src/bin/completions.rs index ee0c5fa01c..5a6374d68b 100644 --- a/git-cliff/src/bin/completions.rs +++ b/git-cliff/src/bin/completions.rs @@ -1,6 +1,6 @@ use clap::{ + ArgEnum, CommandFactory, - ValueEnum, }; use clap_complete::Shell; use git_cliff::args::Opt; diff --git a/git-cliff/src/lib.rs b/git-cliff/src/lib.rs index cf94f57405..b70d9ca523 100644 --- a/git-cliff/src/lib.rs +++ b/git-cliff/src/lib.rs @@ -9,7 +9,7 @@ use args::{ Sort, Strip, }; -use clap::ValueEnum; +use clap::ArgEnum; use git_cliff_core::changelog::Changelog; use git_cliff_core::commit::Commit; use git_cliff_core::config::Config; From 2cabb9e78233be021199f9eaad4f15fed8a28273 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Sat, 23 Sep 2023 12:33:50 -0700 Subject: [PATCH 2/2] chore: update to clap 4.4.4 --- Cargo.lock | 236 +++++++++++++------------------ git-cliff/Cargo.toml | 16 +-- git-cliff/src/args.rs | 74 +++++----- git-cliff/src/bin/completions.rs | 2 +- git-cliff/src/lib.rs | 2 +- 5 files changed, 145 insertions(+), 185 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f24a507d20..d990fb51d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,25 +42,62 @@ dependencies = [ ] [[package]] -name = "async-trait" -version = "0.1.73" +name = "anstream" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", ] [[package]] -name = "atty" -version = "0.2.14" +name = "anstyle" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "async-trait" +version = "0.1.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -185,63 +222,70 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" dependencies = [ - "atty", - "bitflags 1.3.2", + "clap_builder", "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "indexmap 1.9.3", - "once_cell", "strsim", - "termcolor", "terminal_size", - "textwrap", ] [[package]] name = "clap_complete" -version = "3.2.5" +version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f7a2e0a962c45ce25afce14220bc24f9dade0a1787f185cecf96bfba7847cd8" +checksum = "4110a1e6af615a9e6d0a36f805d5c99099f8bab9b8042f5bc1fa220a4a89e36f" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "3.2.25" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "clap_mangen" -version = "0.1.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "105180c05a72388d5f5e4e4f6c79eecb92497bda749fa8f963a16647c5d5377f" +checksum = "b44f35c514163027542f7147797ff930523eea288e03642727348ef1a9666f6b" dependencies = [ "clap", "roff", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "config" version = "0.13.3" @@ -473,7 +517,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -663,15 +707,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.3" @@ -835,17 +870,6 @@ dependencies = [ "hashbrown 0.14.0", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.3", - "libc", - "windows-sys", -] - [[package]] name = "ipnet" version = "2.8.0" @@ -858,8 +882,8 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.3", - "rustix 0.38.14", + "hermit-abi", + "rustix", "windows-sys", ] @@ -907,7 +931,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.37", + "syn", ] [[package]] @@ -958,12 +982,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.7" @@ -1039,7 +1057,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi", "libc", ] @@ -1064,12 +1082,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "os_str_bytes" -version = "6.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" - [[package]] name = "parse-zoneinfo" version = "0.3.0" @@ -1122,7 +1134,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -1218,30 +1230,6 @@ dependencies = [ "log", ] -[[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 1.0.109", - "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-macro2" version = "1.0.67" @@ -1419,7 +1407,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.37", + "syn", "walkdir", ] @@ -1439,20 +1427,6 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustix" -version = "0.37.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys", -] - [[package]] name = "rustix" version = "0.38.14" @@ -1462,7 +1436,7 @@ dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.7", + "linux-raw-sys", "windows-sys", ] @@ -1555,7 +1529,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -1676,17 +1650,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.37" @@ -1731,23 +1694,14 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.37.23", + "rustix", "windows-sys", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" -dependencies = [ - "terminal_size", -] - [[package]] name = "thiserror" version = "1.0.48" @@ -1765,7 +1719,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -2049,6 +2003,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "vcpkg" version = "0.2.15" @@ -2107,7 +2067,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn", "wasm-bindgen-shared", ] @@ -2141,7 +2101,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/git-cliff/Cargo.toml b/git-cliff/Cargo.toml index ebefd550c7..0b17e20333 100644 --- a/git-cliff/Cargo.toml +++ b/git-cliff/Cargo.toml @@ -29,24 +29,18 @@ default = ["update-informer"] glob.workspace = true regex.workspace = true log.workspace = true -pretty_env_logger = "0.5.0" dirs-next = "2.0.0" -clap_complete = "3.2.5" -clap_mangen = "0.1.11" +clap = { version = "4.4.4", features = ["derive", "env", "wrap_help", "cargo"] } +clap_complete = "4.4.0" +clap_mangen = "0.2.14" +pretty_env_logger = "0.5.0" shellexpand = "3.1.0" +update-informer = { version = "1.1.0", optional = true } [dependencies.git-cliff-core] version = "1.3.0" # managed by release.sh path = "../git-cliff-core" -[dependencies.clap] -version = "3.2.22" -features = ["derive", "env", "wrap_help"] - -[dependencies.update-informer] -version = "1.1.0" -optional = true - [dev-dependencies] pretty_assertions = "1.4.0" diff --git a/git-cliff/src/args.rs b/git-cliff/src/args.rs index cfc4246315..e1657a3343 100644 --- a/git-cliff/src/args.rs +++ b/git-cliff/src/args.rs @@ -1,20 +1,20 @@ use clap::{ - AppSettings, - ArgEnum, + ArgAction, Parser, + ValueEnum, }; use git_cliff_core::DEFAULT_CONFIG; use glob::Pattern; use std::path::PathBuf; -#[derive(Debug, Clone, Copy, ArgEnum)] +#[derive(Debug, Clone, Copy, ValueEnum)] pub enum Strip { Header, Footer, All, } -#[derive(Debug, Clone, Copy, PartialEq, Eq, ArgEnum)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] pub enum Sort { Oldest, Newest, @@ -22,11 +22,10 @@ pub enum Sort { /// Command-line arguments to parse. #[derive(Debug, Parser)] -#[clap( +#[command( version, author, about, - global_setting = AppSettings::DeriveDisplayOrder, rename_all_env = "screaming-snake", help_template = "\ {before-help}{name} {version} @@ -37,61 +36,68 @@ pub enum Sort { {all-args}{after-help} ", override_usage = "git-cliff [FLAGS] [OPTIONS] [--] [RANGE]", - mut_arg("help", |arg| arg.help("Prints help information").help_heading("FLAGS")), - mut_arg("version", |arg| arg.help("Prints version information").help_heading("FLAGS")) + next_help_heading = Some("OPTIONS"), + disable_help_flag = true, + disable_version_flag = true, )] pub struct Opt { + /// Prints help information. + #[arg(short, long, action = ArgAction::Help, global = true, help_heading = Some("FLAGS"))] + pub help: bool, + /// Prints version information. + #[arg(short = 'V', long, action = ArgAction::Version, global = true, help_heading = Some("FLAGS"))] + pub version: bool, /// Increases the logging verbosity. - #[clap(short, long, parse(from_occurrences), alias = "debug", help_heading = Some("FLAGS"))] + #[arg(short, long, action = ArgAction::Count, alias = "debug", help_heading = Some("FLAGS"))] pub verbose: u8, /// Sets the configuration file. - #[clap(short, long, env = "GIT_CLIFF_CONFIG", value_name = "PATH", default_value = DEFAULT_CONFIG, value_parser = Opt::parse_dir)] + #[arg(short, long, env = "GIT_CLIFF_CONFIG", value_name = "PATH", default_value = DEFAULT_CONFIG, value_parser = Opt::parse_dir)] pub config: PathBuf, /// Sets the working directory. - #[clap(short, long, env = "GIT_CLIFF_WORKDIR", value_name = "PATH", value_parser = Opt::parse_dir)] + #[arg(short, long, env = "GIT_CLIFF_WORKDIR", value_name = "PATH", value_parser = Opt::parse_dir)] pub workdir: Option, /// Sets the git repository. - #[clap( + #[arg( short, long, env = "GIT_CLIFF_REPOSITORY", value_name = "PATH", - multiple_values = true, - value_parser = Opt::parse_dir, + num_args = 1.., + value_parser = Opt::parse_dir, )] pub repository: Option>, /// Sets the path to include related commits. - #[clap( + #[arg( long, env = "GIT_CLIFF_INCLUDE_PATH", value_name = "PATTERN", - multiple_values = true + num_args = 1.., )] pub include_path: Option>, /// Sets the path to exclude related commits. - #[clap( + #[arg( long, env = "GIT_CLIFF_EXCLUDE_PATH", value_name = "PATTERN", - multiple_values = true + num_args = 1.., )] pub exclude_path: Option>, /// Sets custom commit messages to include in the changelog. - #[clap( + #[arg( long, env = "GIT_CLIFF_WITH_COMMIT", value_name = "MSG", - multiple_values = true + num_args = 1.., )] pub with_commit: Option>, /// Prepends entries to the given changelog file. - #[clap(short, long, env = "GIT_CLIFF_PREPEND", value_name = "PATH", value_parser = Opt::parse_dir)] + #[arg(short, long, env = "GIT_CLIFF_PREPEND", value_name = "PATH", value_parser = Opt::parse_dir)] pub prepend: Option, /// Writes output to the given file. - #[clap(short, long, env = "GIT_CLIFF_OUTPUT", value_name = "PATH", value_parser = Opt::parse_dir)] + #[arg(short, long, env = "GIT_CLIFF_OUTPUT", value_name = "PATH", value_parser = Opt::parse_dir)] pub output: Option, /// Sets the tag for the latest version. - #[clap( + #[arg( short, long, env = "GIT_CLIFF_TAG", @@ -100,7 +106,7 @@ pub struct Opt { )] pub tag: Option, /// Sets the template for the changelog body. - #[clap( + #[arg( short, long, env = "GIT_CLIFF_TEMPLATE", @@ -109,35 +115,35 @@ pub struct Opt { )] pub body: Option, /// Writes the default configuration file to cliff.toml - #[clap(short, long, help_heading = Some("FLAGS"))] + #[arg(short, long, help_heading = Some("FLAGS"))] pub init: bool, /// Processes the commits starting from the latest tag. - #[clap(short, long, help_heading = Some("FLAGS"))] + #[arg(short, long, help_heading = Some("FLAGS"))] pub latest: bool, /// Processes the commits that belong to the current tag. - #[clap(long, help_heading = Some("FLAGS"))] + #[arg(long, help_heading = Some("FLAGS"))] pub current: bool, /// Processes the commits that do not belong to a tag. - #[clap(short, long, help_heading = Some("FLAGS"))] + #[arg(short, long, help_heading = Some("FLAGS"))] pub unreleased: bool, /// Sorts the tags topologically. - #[clap(long, help_heading = Some("FLAGS"))] + #[arg(long, help_heading = Some("FLAGS"))] pub topo_order: bool, /// Prints changelog context as JSON. - #[clap(long, help_heading = Some("FLAGS"))] + #[arg(long, help_heading = Some("FLAGS"))] pub context: bool, /// Strips the given parts from the changelog. - #[clap(short, long, value_name = "PART", arg_enum)] + #[arg(short, long, value_name = "PART", value_enum)] pub strip: Option, /// Sets sorting of the commits inside sections. - #[clap( + #[arg( long, - arg_enum, + value_enum, default_value_t = Sort::Oldest )] pub sort: Sort, /// Sets the commit range to process. - #[clap(value_name = "RANGE", help_heading = Some("ARGS"))] + #[arg(value_name = "RANGE", help_heading = Some("ARGS"))] pub range: Option, } diff --git a/git-cliff/src/bin/completions.rs b/git-cliff/src/bin/completions.rs index 5a6374d68b..ee0c5fa01c 100644 --- a/git-cliff/src/bin/completions.rs +++ b/git-cliff/src/bin/completions.rs @@ -1,6 +1,6 @@ use clap::{ - ArgEnum, CommandFactory, + ValueEnum, }; use clap_complete::Shell; use git_cliff::args::Opt; diff --git a/git-cliff/src/lib.rs b/git-cliff/src/lib.rs index b70d9ca523..cf94f57405 100644 --- a/git-cliff/src/lib.rs +++ b/git-cliff/src/lib.rs @@ -9,7 +9,7 @@ use args::{ Sort, Strip, }; -use clap::ArgEnum; +use clap::ValueEnum; use git_cliff_core::changelog::Changelog; use git_cliff_core::commit::Commit; use git_cliff_core::config::Config;