diff options
Diffstat (limited to '')
-rw-r--r-- | vendor/clap_builder/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/clap_builder/Cargo.toml | 30 | ||||
-rw-r--r-- | vendor/clap_builder/src/builder/arg.rs | 2 | ||||
-rw-r--r-- | vendor/clap_builder/src/builder/command.rs | 60 | ||||
-rw-r--r-- | vendor/clap_builder/src/builder/debug_asserts.rs | 16 | ||||
-rw-r--r-- | vendor/clap_builder/src/builder/os_str.rs | 2 | ||||
-rw-r--r-- | vendor/clap_builder/src/builder/str.rs | 2 | ||||
-rw-r--r-- | vendor/clap_builder/src/parser/parser.rs | 6 | ||||
-rw-r--r-- | vendor/clap_builder/src/util/any_value.rs | 2 |
9 files changed, 78 insertions, 44 deletions
diff --git a/vendor/clap_builder/.cargo-checksum.json b/vendor/clap_builder/.cargo-checksum.json index f107a15d3..c19dd2b4b 100644 --- a/vendor/clap_builder/.cargo-checksum.json +++ b/vendor/clap_builder/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"9fbd8b138d9dc414f6637500bb6cd733ff509394498499aef6aaa89411a13c27","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"0d687e1f07b58fe68bda74668ff6326125e5e5efa184cce755cd84ac535b7058","README.md":"60b99346464866941b21928d3c4699fd6a3ca85a541da7577f60bc691b7afef8","src/builder/action.rs":"9b920d2d405825ce89a5ba3b59edc66e3b849841819e9742b19010a81584fee7","src/builder/app_settings.rs":"286f925717fa54fe9d2ed6f2f338293b7a5981fee0fe687fe706118cebf1f6f4","src/builder/arg.rs":"032d895f056c29e5bef013b5eedcce396e4770a39a7f628fb29480e2a97e9220","src/builder/arg_group.rs":"82a6e9afeea1792a4ca99baa3b0d3235eb012b037cc19333ed9b03a13bb66f30","src/builder/arg_predicate.rs":"4fe55fdd0441acb1577f28188c86f920df4863f451a7dcad8e050dbb6e1e7516","src/builder/arg_settings.rs":"e8ad1bd6d36da43d7329b6cd86833d4cc63734e64119c6b950a45ded5e3aec9c","src/builder/command.rs":"c66c2e2b3ce9e6dfcf46ce12853d96fde671c4bf3275478d97c65adfd5909e4d","src/builder/debug_asserts.rs":"8c51bed316deceb349f900c83233866388eceb8d6ad6641e60bf2cb17738a808","src/builder/ext.rs":"736cfb56f765cbe23301ebcad83fbe3edfc778954edc4747ccf7c23104d85638","src/builder/mod.rs":"478946dd41eb4adcfd7a3e6159ad1474993fa89e9f1ec62aaf05c213d33be9d7","src/builder/os_str.rs":"2b635e4fa8ecc42ad1d964a8b2f0fe17aa57d976c163d3bf77f213de254d844f","src/builder/possible_value.rs":"2ed44c5a353c0abab337ac0f00995066f96ff27c33098613642725991163edff","src/builder/range.rs":"63583801f2f9daa43906bda84eb3a2ba9d6b5157745180acbc0a3284babe2d94","src/builder/resettable.rs":"c4cd481051ec361529817ebae73b4dd307b0a4a3b88a3ddcecb8dd45b05db431","src/builder/str.rs":"e51a1e5c18364c9132d1c7df113e6a462265e40f767087fa9664bfcd5f5d91b4","src/builder/styled_str.rs":"9a605e1fe93f602809645447b4560ad767292eac9a17614c8cdca697d813425e","src/builder/styling.rs":"3aac44f140d5247d27f661e328a05eae0bd8c6685c8bfc88ec703d3a21a47f50","src/builder/tests.rs":"565f5efd38c6596e55fa1c077a11cc07be94ca201527963d27fd42ddce6dbbe8","src/builder/value_hint.rs":"66588792cddf7e3bb2912da4e0a53584169c266f9e4e6dcb990295998d158f93","src/builder/value_parser.rs":"915fb8d50910711d5b704fab4c8fbcb3f1e0e2e66fef722e5806513618864477","src/derive.rs":"7e9e33ecb4c834ff1b6bcffd24358b3e2cfc946a5dc69f5ca8088f7ac4f145ce","src/error/context.rs":"156d2611a349ce826378476c9dcb3242a01ad834a095baad096a10cc2f73e1ed","src/error/format.rs":"33903b182f9b8fde0a2ad2f5f96582ed3812d37c51a03f2c775553db8351e5e8","src/error/kind.rs":"29603c64b8cea7886498afc3f7e7c489505c9820c5159e99d153d57fdafe95ec","src/error/mod.rs":"2ebe49387552c56e1b632fe647e45cbb71d590366785972758aecd04f88f9b90","src/lib.rs":"8b08b2d74ffc9c383f861ec94e41d02ea7c035081f44acd37079baeb1888e5a8","src/macros.rs":"f2c7145b2b10d36a7c2e0cc02502115be4162d2256e12328222121f4eefeb2b5","src/mkeymap.rs":"a644643a54ab1a6e353af4c746efc2c2e9e161e64fe3f3635c644748e02690d8","src/output/fmt.rs":"17d7c95bae851fd0ffb7d3ea4c3c1830963c8b863aa8e4e296e3d824a1da18dc","src/output/help.rs":"b3bb6cfffe9c1113d377f1f4951a22b6ad2ba2813dcc55a146899c808cd393d3","src/output/help_template.rs":"19e725674a92ef2a529e7583c0c139d04a420617be5e91e65341a2063b3d8a68","src/output/mod.rs":"74ea52be8981c30d10fda3f6c80cf51aafb15700de99aa73bc94700bca25ae11","src/output/textwrap/core.rs":"0d45b1ebe8bba3e54e8bcbfec015be626d55803a0a46aef753eb3a4be3cabab4","src/output/textwrap/mod.rs":"1bc5056701b6651a98b0eea482db5235ba3342a24a02d776ad364fec6919cecc","src/output/textwrap/word_separators.rs":"ae3af310295e707ae1aa95633f6bb078cedf8f65662a86caa9d25420f459acc1","src/output/textwrap/wrap_algorithms.rs":"a6eb1491ef5e64dbd2ef55d367e46747fcf2fb22fdb66a2b7c3cb9ba3a02d86a","src/output/usage.rs":"45dcf5520f0625da75f1ceb1d749aaeb13db882f64025ea89d039a2acfd72898","src/parser/arg_matcher.rs":"b6f17cfc48d18d192d6f4f45b9daf342b93d847ce7d52a3f68266c15566c3849","src/parser/error.rs":"7def6f001ad6dfd262d71149c6e4f3845a6f7bf246a92edc6d872e3ca4e2ae01","src/parser/features/mod.rs":"6ed075e97af56bff22f22ed1ee83ff6479360e05f9d3661a3145f822c242b694","src/parser/features/suggestions.rs":"832b62f927f9f4ffb95abdcef09c8b675045aab0b5471bae484e5d07f18f7621","src/parser/matches/arg_matches.rs":"902f512272d9c4a0c8be7ff3e5122b088ee6fde1694a7b4cfba88f941b361a3b","src/parser/matches/matched_arg.rs":"8533197ac8f1a1a218844c34923beabd0ed0d28447b03bd9d4d199cc7ff251d0","src/parser/matches/mod.rs":"5578335f4b9103cc4060546621e5664d5e92c43848ec48c2d95a4b045373de1f","src/parser/matches/value_source.rs":"ecb9e09db06579489daa9cbcf351381041dff7c5e2956fb96052b70b9360955b","src/parser/mod.rs":"34d689dac5d878790e5c29872f59ccec000ceab737ddaa642054cb464e26edb8","src/parser/parser.rs":"2c7951e94952ce86005115cd3b3d68bf36b9001cbbcbef360843294bb016cd2b","src/parser/validator.rs":"107c4eaa1615c0414553862f0250e9bf4241cccb7d7ec6df4ac8784f5f850d11","src/util/any_value.rs":"f3666cf322e87daf83f1474d5449e9b526b80b835f032e4090c5e1abddf6f044","src/util/color.rs":"04cc72927ad1e7f5490e1db39b7f79b16ed613b7b81cfe0285b38ba9d0afb875","src/util/flat_map.rs":"89e6471d099485f943ed7331626db6fddd75598f2c98623a13f262ff1a08b509","src/util/flat_set.rs":"334f3b8a72a897fbabd68f2330a8ecc18af74492036822b2e3764d461ddf31b4","src/util/graph.rs":"f35396b6e2a427377dcbbca69b1b98737d89684a3834cfda98cbf8cc70ff9c2f","src/util/id.rs":"5f025a05e4752ef7d610d6490f4a83ab489b1e5038c1a15067c0be51caafde87","src/util/mod.rs":"010f54d58906f4ae0106f2f1a891ea80a55fd52c64b8946a6b59e20f9c502418","src/util/str_to_bool.rs":"1ce90b4939a884eeefc73392722bdfcf906e3070c4398e1557c586c10c684cd0"},"package":"0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45"}
\ No newline at end of file +{"files":{"Cargo.toml":"1e0275e303ef6639e44aafe136acac3c656531119a895688e9e5e23d3e9af1a1","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"0d687e1f07b58fe68bda74668ff6326125e5e5efa184cce755cd84ac535b7058","README.md":"60b99346464866941b21928d3c4699fd6a3ca85a541da7577f60bc691b7afef8","src/builder/action.rs":"9b920d2d405825ce89a5ba3b59edc66e3b849841819e9742b19010a81584fee7","src/builder/app_settings.rs":"286f925717fa54fe9d2ed6f2f338293b7a5981fee0fe687fe706118cebf1f6f4","src/builder/arg.rs":"6d70b08ed37bfc389a4caa4a3b483cae6ed6742d6adb60ab1663cf429805ebd6","src/builder/arg_group.rs":"82a6e9afeea1792a4ca99baa3b0d3235eb012b037cc19333ed9b03a13bb66f30","src/builder/arg_predicate.rs":"4fe55fdd0441acb1577f28188c86f920df4863f451a7dcad8e050dbb6e1e7516","src/builder/arg_settings.rs":"e8ad1bd6d36da43d7329b6cd86833d4cc63734e64119c6b950a45ded5e3aec9c","src/builder/command.rs":"ec064237a6f7504eac26e0394117ea0422465e6817e718a3dc7e380403d0c304","src/builder/debug_asserts.rs":"ee0bc672dac85590102ae3189f61af2c1b202ceaa7835e3df45d89dca274cdae","src/builder/ext.rs":"736cfb56f765cbe23301ebcad83fbe3edfc778954edc4747ccf7c23104d85638","src/builder/mod.rs":"478946dd41eb4adcfd7a3e6159ad1474993fa89e9f1ec62aaf05c213d33be9d7","src/builder/os_str.rs":"8d9efc619a697e314c42bf8c320f26e7d5ca33996ea577d3f74325a8dbf43df5","src/builder/possible_value.rs":"2ed44c5a353c0abab337ac0f00995066f96ff27c33098613642725991163edff","src/builder/range.rs":"63583801f2f9daa43906bda84eb3a2ba9d6b5157745180acbc0a3284babe2d94","src/builder/resettable.rs":"c4cd481051ec361529817ebae73b4dd307b0a4a3b88a3ddcecb8dd45b05db431","src/builder/str.rs":"270f21e462fd7ebe54a3c0f3010d6b1a7f672e4135cb77f51b6188c7f8d46ca7","src/builder/styled_str.rs":"9a605e1fe93f602809645447b4560ad767292eac9a17614c8cdca697d813425e","src/builder/styling.rs":"3aac44f140d5247d27f661e328a05eae0bd8c6685c8bfc88ec703d3a21a47f50","src/builder/tests.rs":"565f5efd38c6596e55fa1c077a11cc07be94ca201527963d27fd42ddce6dbbe8","src/builder/value_hint.rs":"66588792cddf7e3bb2912da4e0a53584169c266f9e4e6dcb990295998d158f93","src/builder/value_parser.rs":"915fb8d50910711d5b704fab4c8fbcb3f1e0e2e66fef722e5806513618864477","src/derive.rs":"7e9e33ecb4c834ff1b6bcffd24358b3e2cfc946a5dc69f5ca8088f7ac4f145ce","src/error/context.rs":"156d2611a349ce826378476c9dcb3242a01ad834a095baad096a10cc2f73e1ed","src/error/format.rs":"33903b182f9b8fde0a2ad2f5f96582ed3812d37c51a03f2c775553db8351e5e8","src/error/kind.rs":"29603c64b8cea7886498afc3f7e7c489505c9820c5159e99d153d57fdafe95ec","src/error/mod.rs":"2ebe49387552c56e1b632fe647e45cbb71d590366785972758aecd04f88f9b90","src/lib.rs":"8b08b2d74ffc9c383f861ec94e41d02ea7c035081f44acd37079baeb1888e5a8","src/macros.rs":"f2c7145b2b10d36a7c2e0cc02502115be4162d2256e12328222121f4eefeb2b5","src/mkeymap.rs":"a644643a54ab1a6e353af4c746efc2c2e9e161e64fe3f3635c644748e02690d8","src/output/fmt.rs":"17d7c95bae851fd0ffb7d3ea4c3c1830963c8b863aa8e4e296e3d824a1da18dc","src/output/help.rs":"b3bb6cfffe9c1113d377f1f4951a22b6ad2ba2813dcc55a146899c808cd393d3","src/output/help_template.rs":"19e725674a92ef2a529e7583c0c139d04a420617be5e91e65341a2063b3d8a68","src/output/mod.rs":"74ea52be8981c30d10fda3f6c80cf51aafb15700de99aa73bc94700bca25ae11","src/output/textwrap/core.rs":"0d45b1ebe8bba3e54e8bcbfec015be626d55803a0a46aef753eb3a4be3cabab4","src/output/textwrap/mod.rs":"1bc5056701b6651a98b0eea482db5235ba3342a24a02d776ad364fec6919cecc","src/output/textwrap/word_separators.rs":"ae3af310295e707ae1aa95633f6bb078cedf8f65662a86caa9d25420f459acc1","src/output/textwrap/wrap_algorithms.rs":"a6eb1491ef5e64dbd2ef55d367e46747fcf2fb22fdb66a2b7c3cb9ba3a02d86a","src/output/usage.rs":"45dcf5520f0625da75f1ceb1d749aaeb13db882f64025ea89d039a2acfd72898","src/parser/arg_matcher.rs":"b6f17cfc48d18d192d6f4f45b9daf342b93d847ce7d52a3f68266c15566c3849","src/parser/error.rs":"7def6f001ad6dfd262d71149c6e4f3845a6f7bf246a92edc6d872e3ca4e2ae01","src/parser/features/mod.rs":"6ed075e97af56bff22f22ed1ee83ff6479360e05f9d3661a3145f822c242b694","src/parser/features/suggestions.rs":"832b62f927f9f4ffb95abdcef09c8b675045aab0b5471bae484e5d07f18f7621","src/parser/matches/arg_matches.rs":"902f512272d9c4a0c8be7ff3e5122b088ee6fde1694a7b4cfba88f941b361a3b","src/parser/matches/matched_arg.rs":"8533197ac8f1a1a218844c34923beabd0ed0d28447b03bd9d4d199cc7ff251d0","src/parser/matches/mod.rs":"5578335f4b9103cc4060546621e5664d5e92c43848ec48c2d95a4b045373de1f","src/parser/matches/value_source.rs":"ecb9e09db06579489daa9cbcf351381041dff7c5e2956fb96052b70b9360955b","src/parser/mod.rs":"34d689dac5d878790e5c29872f59ccec000ceab737ddaa642054cb464e26edb8","src/parser/parser.rs":"f177bf3182addb6d271f8a676fb145337a1e7b1eeec7adcc5b61548d11947eb6","src/parser/validator.rs":"107c4eaa1615c0414553862f0250e9bf4241cccb7d7ec6df4ac8784f5f850d11","src/util/any_value.rs":"ac88e78c520ae84edb160c121d1277ce64db3aea7199fbddfe1024d6c312f722","src/util/color.rs":"04cc72927ad1e7f5490e1db39b7f79b16ed613b7b81cfe0285b38ba9d0afb875","src/util/flat_map.rs":"89e6471d099485f943ed7331626db6fddd75598f2c98623a13f262ff1a08b509","src/util/flat_set.rs":"334f3b8a72a897fbabd68f2330a8ecc18af74492036822b2e3764d461ddf31b4","src/util/graph.rs":"f35396b6e2a427377dcbbca69b1b98737d89684a3834cfda98cbf8cc70ff9c2f","src/util/id.rs":"5f025a05e4752ef7d610d6490f4a83ab489b1e5038c1a15067c0be51caafde87","src/util/mod.rs":"010f54d58906f4ae0106f2f1a891ea80a55fd52c64b8946a6b59e20f9c502418","src/util/str_to_bool.rs":"1ce90b4939a884eeefc73392722bdfcf906e3070c4398e1557c586c10c684cd0"},"package":"c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663"}
\ No newline at end of file diff --git a/vendor/clap_builder/Cargo.toml b/vendor/clap_builder/Cargo.toml index e02965142..a0d1232de 100644 --- a/vendor/clap_builder/Cargo.toml +++ b/vendor/clap_builder/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.70.0" name = "clap_builder" -version = "4.4.6" +version = "4.4.7" include = [ "build.rs", "src/**/*", @@ -70,7 +70,7 @@ version = "0.3.67" optional = true [dependencies.clap_lex] -version = "0.5.0" +version = "0.6.0" [dependencies.strsim] version = "0.10.0" @@ -89,35 +89,11 @@ version = "0.1.9" optional = true [dev-dependencies.color-print] -version = "0.3.4" - -[dev-dependencies.humantime] -version = "2.1.0" - -[dev-dependencies.rustversion] -version = "1.0.14" - -[dev-dependencies.shlex] -version = "1.1.0" - -[dev-dependencies.snapbox] -version = "0.4.13" +version = "0.3.5" [dev-dependencies.static_assertions] version = "1.1.0" -[dev-dependencies.trybuild] -version = "1.0.83" - -[dev-dependencies.trycmd] -version = "0.14.18" -features = [ - "color-auto", - "diff", - "examples", -] -default-features = false - [dev-dependencies.unic-emoji-char] version = "0.9.0" diff --git a/vendor/clap_builder/src/builder/arg.rs b/vendor/clap_builder/src/builder/arg.rs index 5634078c5..8e247c176 100644 --- a/vendor/clap_builder/src/builder/arg.rs +++ b/vendor/clap_builder/src/builder/arg.rs @@ -1617,7 +1617,7 @@ impl Arg { /// ``` /// /// Will result in everything after `--` to be considered one raw argument. This behavior - /// may not be exactly what you are expecting and using [`crate::Command::trailing_var_arg`] + /// may not be exactly what you are expecting and using [`Arg::trailing_var_arg`] /// may be more appropriate. /// /// **NOTE:** Implicitly sets [`Arg::action(ArgAction::Set)`] [`Arg::num_args(1..)`], diff --git a/vendor/clap_builder/src/builder/command.rs b/vendor/clap_builder/src/builder/command.rs index b1623cf8c..edcbace76 100644 --- a/vendor/clap_builder/src/builder/command.rs +++ b/vendor/clap_builder/src/builder/command.rs @@ -746,7 +746,7 @@ impl Command { I: IntoIterator<Item = T>, T: Into<OsString> + Clone, { - let mut raw_args = clap_lex::RawArgs::new(itr.into_iter()); + let mut raw_args = clap_lex::RawArgs::new(itr); let mut cursor = raw_args.cursor(); if self.settings.is_set(AppSettings::Multicall) { @@ -1244,12 +1244,41 @@ impl Command { /// # use clap_builder as clap; /// # use clap::{Command, error::ErrorKind}; /// let res = Command::new("myprog") + /// .version("1.0.0") /// .disable_version_flag(true) /// .try_get_matches_from(vec![ + /// "myprog", "--version" + /// ]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind(), ErrorKind::UnknownArgument); + /// ``` + /// + /// You can create a custom version flag with [`ArgAction::Version`] + /// ```rust + /// # use clap_builder as clap; + /// # use clap::{Command, Arg, ArgAction, error::ErrorKind}; + /// let mut cmd = Command::new("myprog") + /// .version("1.0.0") + /// // Remove the `-V` short flag + /// .disable_version_flag(true) + /// .arg( + /// Arg::new("version") + /// .long("version") + /// .action(ArgAction::Version) + /// .help("Print version") + /// ); + /// + /// let res = cmd.try_get_matches_from_mut(vec![ /// "myprog", "-V" /// ]); /// assert!(res.is_err()); /// assert_eq!(res.unwrap_err().kind(), ErrorKind::UnknownArgument); + /// + /// let res = cmd.try_get_matches_from_mut(vec![ + /// "myprog", "--version" + /// ]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind(), ErrorKind::DisplayVersion); /// ``` #[inline] pub fn disable_version_flag(self, yes: bool) -> Self { @@ -1329,6 +1358,35 @@ impl Command { /// assert!(res.is_err()); /// assert_eq!(res.unwrap_err().kind(), ErrorKind::UnknownArgument); /// ``` + /// + /// You can create a custom version flag with [`ArgAction::Help`], [`ArgAction::HelpShort`], or + /// [`ArgAction::HelpLong`] + /// ```rust + /// # use clap_builder as clap; + /// # use clap::{Command, Arg, ArgAction, error::ErrorKind}; + /// let mut cmd = Command::new("myprog") + /// // Change help short flag to `?` + /// .disable_help_flag(true) + /// .arg( + /// Arg::new("help") + /// .short('?') + /// .long("help") + /// .action(ArgAction::Help) + /// .help("Print help") + /// ); + /// + /// let res = cmd.try_get_matches_from_mut(vec![ + /// "myprog", "-h" + /// ]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind(), ErrorKind::UnknownArgument); + /// + /// let res = cmd.try_get_matches_from_mut(vec![ + /// "myprog", "-?" + /// ]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind(), ErrorKind::DisplayHelp); + /// ``` #[inline] pub fn disable_help_flag(self, yes: bool) -> Self { if yes { diff --git a/vendor/clap_builder/src/builder/debug_asserts.rs b/vendor/clap_builder/src/builder/debug_asserts.rs index afc181c54..2b633849f 100644 --- a/vendor/clap_builder/src/builder/debug_asserts.rs +++ b/vendor/clap_builder/src/builder/debug_asserts.rs @@ -405,6 +405,12 @@ impl PartialEq for Flag<'_> { impl PartialOrd for Flag<'_> { fn partial_cmp(&self, other: &Flag) -> Option<Ordering> { + Some(self.cmp(other)) + } +} + +impl Ord for Flag<'_> { + fn cmp(&self, other: &Self) -> Ordering { use Flag::*; match (self, other) { @@ -413,21 +419,15 @@ impl PartialOrd for Flag<'_> { | (Command(s1, _), Arg(s2, _)) | (Arg(s1, _), Command(s2, _)) => { if s1 == s2 { - Some(Ordering::Equal) + Ordering::Equal } else { - s1.partial_cmp(s2) + s1.cmp(s2) } } } } } -impl Ord for Flag<'_> { - fn cmp(&self, other: &Self) -> Ordering { - self.partial_cmp(other).unwrap() - } -} - fn detect_duplicate_flags(flags: &[Flag], short_or_long: &str) { use Flag::*; diff --git a/vendor/clap_builder/src/builder/os_str.rs b/vendor/clap_builder/src/builder/os_str.rs index 6bd9282ec..fe8928e09 100644 --- a/vendor/clap_builder/src/builder/os_str.rs +++ b/vendor/clap_builder/src/builder/os_str.rs @@ -316,7 +316,7 @@ impl PartialEq for Inner { impl PartialOrd for Inner { fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { - self.as_os_str().partial_cmp(other.as_os_str()) + Some(self.cmp(other)) } } diff --git a/vendor/clap_builder/src/builder/str.rs b/vendor/clap_builder/src/builder/str.rs index 9bded8147..cf876910a 100644 --- a/vendor/clap_builder/src/builder/str.rs +++ b/vendor/clap_builder/src/builder/str.rs @@ -290,7 +290,7 @@ impl PartialEq for Inner { impl PartialOrd for Inner { fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { - self.as_str().partial_cmp(other.as_str()) + Some(self.cmp(other)) } } diff --git a/vendor/clap_builder/src/parser/parser.rs b/vendor/clap_builder/src/parser/parser.rs index fcde4a86e..4b24eb0de 100644 --- a/vendor/clap_builder/src/parser/parser.rs +++ b/vendor/clap_builder/src/parser/parser.rs @@ -643,7 +643,7 @@ impl<'cmd> Parser<'cmd> { if self.cmd[current_positional.get_id()].is_allow_hyphen_values_set() || (self.cmd[current_positional.get_id()].is_allow_negative_numbers_set() - && next.is_number()) + && next.is_negative_number()) { // If allow hyphen, this isn't a new arg. debug!("Parser::is_new_arg: Allow hyphen"); @@ -841,7 +841,7 @@ impl<'cmd> Parser<'cmd> { #[allow(clippy::blocks_in_if_conditions)] if matches!(parse_state, ParseState::Opt(opt) | ParseState::Pos(opt) - if self.cmd[opt].is_allow_hyphen_values_set() || (self.cmd[opt].is_allow_negative_numbers_set() && short_arg.is_number())) + if self.cmd[opt].is_allow_hyphen_values_set() || (self.cmd[opt].is_allow_negative_numbers_set() && short_arg.is_negative_number())) { debug!("Parser::parse_short_args: prior arg accepts hyphenated values",); return Ok(ParseResult::MaybeHyphenValue); @@ -851,7 +851,7 @@ impl<'cmd> Parser<'cmd> { .get(&pos_counter) .map(|arg| arg.is_allow_negative_numbers_set()) .unwrap_or_default() - && short_arg.is_number() + && short_arg.is_negative_number() { debug!("Parser::parse_short_arg: negative number"); return Ok(ParseResult::MaybeHyphenValue); diff --git a/vendor/clap_builder/src/util/any_value.rs b/vendor/clap_builder/src/util/any_value.rs index 6f1e3665e..19aa82b4f 100644 --- a/vendor/clap_builder/src/util/any_value.rs +++ b/vendor/clap_builder/src/util/any_value.rs @@ -65,7 +65,7 @@ impl Eq for AnyValueId {} impl PartialOrd for AnyValueId { fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { - self.type_id.partial_cmp(&other.type_id) + Some(self.cmp(other)) } } |