summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Peter <sharkdp@users.noreply.github.com>2023-02-01 21:36:19 +0100
committerGitHub <noreply@github.com>2023-02-01 21:36:19 +0100
commit73a693ef28edcfac5f78adc40c0fc5c0f7fcf1bc (patch)
tree7997804bc0238c482b13dff7fabc0d1f7ea6a4dd
parent9955e20d01ae9b01dfadda68f172f0bacc9e44a1 (diff)
parentc34bfa30feeb2ff883fe934efe49a4175b35ea08 (diff)
Merge pull request #1244 from tmccombs/grouped-occurrences
update: Update to clap 4.1
-rw-r--r--.github/workflows/CICD.yml2
-rw-r--r--Cargo.lock58
-rw-r--r--Cargo.toml3
-rw-r--r--build.rs2
-rw-r--r--clippy.toml2
-rw-r--r--src/cli.rs4
-rw-r--r--src/exec/mod.rs10
-rw-r--r--tests/tests.rs16
8 files changed, 75 insertions, 22 deletions
diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml
index bdb72b8..5947061 100644
--- a/.github/workflows/CICD.yml
+++ b/.github/workflows/CICD.yml
@@ -1,7 +1,7 @@
name: CICD
env:
- MIN_SUPPORTED_RUST_VERSION: "1.60.0"
+ MIN_SUPPORTED_RUST_VERSION: "1.64.0"
CICD_INTERMEDIATES_DIR: "_cicd-intermediates"
on:
diff --git a/Cargo.lock b/Cargo.lock
index 64e06cc..4755b3f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -101,14 +101,14 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.0.22"
+version = "4.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91b9970d7505127a162fdaa9b96428d28a479ba78c9ec7550a63a5d9863db682"
+checksum = "4ec7a4128863c188deefe750ac1d1dfe66c236909f845af04beed823638dc1b2"
dependencies = [
- "atty",
"bitflags",
"clap_derive",
"clap_lex",
+ "is-terminal",
"once_cell",
"strsim",
"termcolor",
@@ -126,9 +126,9 @@ dependencies = [
[[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",
@@ -474,6 +474,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6e481ccbe3dea62107216d0d1138bb8ad8e5e5c43009a098bd1990272c497b0"
[[package]]
+name = "io-lifetimes"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e"
+dependencies = [
+ "libc",
+ "windows-sys 0.42.0",
+]
+
+[[package]]
+name = "is-terminal"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"
+dependencies = [
+ "hermit-abi 0.2.6",
+ "io-lifetimes 1.0.4",
+ "rustix 0.36.6",
+ "windows-sys 0.42.0",
+]
+
+[[package]]
name = "jemalloc-sys"
version = "0.5.2+5.3.0-patched"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -531,6 +553,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d"
[[package]]
+name = "linux-raw-sys"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"
+
+[[package]]
name = "log"
version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -751,13 +779,27 @@ checksum = "985947f9b6423159c4726323f373be0a21bdb514c5af06a849cb3d2dce2d01e8"
dependencies = [
"bitflags",
"errno",
- "io-lifetimes",
+ "io-lifetimes 0.7.4",
"libc",
- "linux-raw-sys",
+ "linux-raw-sys 0.0.46",
"windows-sys 0.36.1",
]
[[package]]
+name = "rustix"
+version = "0.36.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549"
+dependencies = [
+ "bitflags",
+ "errno",
+ "io-lifetimes 1.0.4",
+ "libc",
+ "linux-raw-sys 0.1.4",
+ "windows-sys 0.42.0",
+]
+
+[[package]]
name = "same-file"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -824,7 +866,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8440c860cf79def6164e4a0a983bcc2305d82419177a0e0c71930d049e3ac5a1"
dependencies = [
- "rustix",
+ "rustix 0.35.12",
"windows-sys 0.36.1",
]
diff --git a/Cargo.toml b/Cargo.toml
index 3fbc886..9ac2052 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,6 +18,7 @@ readme = "README.md"
repository = "https://github.com/sharkdp/fd"
version = "8.6.0"
edition= "2021"
+rust-version = "1.64.0"
[badges.appveyor]
repository = "sharkdp/fd"
@@ -52,7 +53,7 @@ clap_complete = {version = "4.0.6", optional = true}
faccess = "0.2.4"
[dependencies.clap]
-version = "4.0.22"
+version = "4.1.1"
features = ["suggestions", "color", "wrap_help", "cargo", "unstable-grouped", "derive"]
[dependencies.chrono]
diff --git a/build.rs b/build.rs
index 224f2d3..5a4c372 100644
--- a/build.rs
+++ b/build.rs
@@ -1,5 +1,5 @@
fn main() {
- let min_version = "1.60";
+ let min_version = "1.64";
match version_check::is_min_version(min_version) {
Some(true) => {}
diff --git a/clippy.toml b/clippy.toml
index 16caf02..22fd4be 100644
--- a/clippy.toml
+++ b/clippy.toml
@@ -1 +1 @@
-msrv = "1.60.0"
+msrv = "1.64.0"
diff --git a/src/cli.rs b/src/cli.rs
index 55fbca8..bb00a1c 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -760,11 +760,11 @@ pub struct Exec {
impl clap::FromArgMatches for Exec {
fn from_arg_matches(matches: &ArgMatches) -> clap::error::Result<Self> {
let command = matches
- .grouped_values_of("exec")
+ .get_occurrences::<String>("exec")
.map(CommandSet::new)
.or_else(|| {
matches
- .grouped_values_of("exec_batch")
+ .get_occurrences::<String>("exec_batch")
.map(CommandSet::new_batch)
})
.transpose()
diff --git a/src/exec/mod.rs b/src/exec/mod.rs
index 167368b..17060b3 100644
--- a/src/exec/mod.rs
+++ b/src/exec/mod.rs
@@ -39,9 +39,10 @@ pub struct CommandSet {
}
impl CommandSet {
- pub fn new<I, S>(input: I) -> Result<CommandSet>
+ pub fn new<I, T, S>(input: I) -> Result<CommandSet>
where
- I: IntoIterator<Item = Vec<S>>,
+ I: IntoIterator<Item = T>,
+ T: IntoIterator<Item = S>,
S: AsRef<str>,
{
Ok(CommandSet {
@@ -53,9 +54,10 @@ impl CommandSet {
})
}
- pub fn new_batch<I, S>(input: I) -> Result<CommandSet>
+ pub fn new_batch<I, T, S>(input: I) -> Result<CommandSet>
where
- I: IntoIterator<Item = Vec<S>>,
+ I: IntoIterator<Item = T>,
+ T: IntoIterator<Item = S>,
S: AsRef<str>,
{
Ok(CommandSet {
diff --git a/tests/tests.rs b/tests/tests.rs
index 6c27a02..5330f40 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -1805,18 +1805,26 @@ fn test_exec_batch() {
\n\
Usage: fd [OPTIONS] [pattern] [path]...\n\
\n\
- For more information try '--help'\n\
+ For more information, try '--help'.\n\
",
);
te.assert_failure_with_error(
&["foo", "--exec-batch", "echo", "{/}", ";", "-x", "echo"],
- "error: The argument '--exec-batch <cmd>...' cannot be used with '--exec <cmd>...'",
+ "error: the argument '--exec-batch <cmd>...' cannot be used with '--exec <cmd>...'\n\
+ \n\
+ Usage: fd --exec-batch <cmd>... <pattern> [path]...\n\
+ \n\
+ For more information, try '--help'.\n\
+ ",
);
te.assert_failure_with_error(
&["foo", "--exec-batch"],
- "error: The argument '--exec-batch <cmd>...' requires a value but none was supplied",
+ "error: a value is required for '--exec-batch <cmd>...' but none was supplied\n\
+ \n\
+ For more information, try '--help'.\n\
+ ",
);
te.assert_failure_with_error(
@@ -1825,7 +1833,7 @@ fn test_exec_batch() {
\n\
Usage: fd [OPTIONS] [pattern] [path]...\n\
\n\
- For more information try '--help'\n\
+ For more information, try '--help'.\n\
",
);