Merge pull request #1244 from tmccombs/grouped-occurrences
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Peter · committed by GitHub · parents 9955e20, c34bfa3 · Browse files · 8 files·+75 added−22 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- update: Update to clap 4.1
Diff stats
8 files+75 added−22 removed
- tests:+12 added−4 removed
- other:+63 added−18 removed
Provenance
- Commit
73a693e- Tree
7997804- Author
David Peter <sharkdp@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent 1
9955e20- Parent 2
c34bfa3
8 files changed+75 added−22 removed
modified:.github/workflows/CICD.yml+1 added-1 removed
1 name: CICD2 3 env:4- MIN_SUPPORTED_RUST_VERSION: "1.60.0"4+ MIN_SUPPORTED_RUST_VERSION: "1.64.0"5 CICD_INTERMEDIATES_DIR: "_cicd-intermediates"6 7 on:8 workflow_dispatch:355 unmodified linesmodified:src/exec/mod.rs+6 added-4 removed
37 unmodified lines38 commands: Vec<CommandTemplate>,39 }40 41 impl CommandSet {42- pub fn new<I, S>(input: I) -> Result<CommandSet>42+ pub fn new<I, T, S>(input: I) -> Result<CommandSet>43 where44- I: IntoIterator<Item = Vec<S>>,44+ I: IntoIterator<Item = T>,45+ T: IntoIterator<Item = S>,46 S: AsRef<str>,47 {48 Ok(CommandSet {49 mode: ExecutionMode::OneByOne,3 unmodified lines53 .collect::<Result<_>>()?,54 })55 }56 56- pub fn new_batch<I, S>(input: I) -> Result<CommandSet>57+ pub fn new_batch<I, T, S>(input: I) -> Result<CommandSet>58 where58- I: IntoIterator<Item = Vec<S>>,59+ I: IntoIterator<Item = T>,60+ T: IntoIterator<Item = S>,61 S: AsRef<str>,62 {63 Ok(CommandSet {64 mode: ExecutionMode::Batch,532 unmodified linesmodified:src/cli.rs+2 added-2 removed
758 unmodified lines759 760 impl clap::FromArgMatches for Exec {761 fn from_arg_matches(matches: &ArgMatches) -> clap::error::Result<Self> {762 let command = matches763- .grouped_values_of("exec")763+ .get_occurrences::<String>("exec")764 .map(CommandSet::new)765 .or_else(|| {766 matches767- .grouped_values_of("exec_batch")767+ .get_occurrences::<String>("exec_batch")768 .map(CommandSet::new_batch)769 })770 .transpose()771 .map_err(|e| clap::Error::raw(ErrorKind::InvalidValue, e))?;90 unmodified linesmodified:tests/tests.rs+12 added-4 removed
1803 unmodified lines1804 "error: Only one placeholder allowed for batch commands\n\1805 \n\1806 Usage: fd [OPTIONS] [pattern] [path]...\n\1807 \n\1808- For more information try '--help'\n\1808+ For more information, try '--help'.\n\1809 ",1810 );1811 1812 te.assert_failure_with_error(1813 &["foo", "--exec-batch", "echo", "{/}", ";", "-x", "echo"],1814- "error: The argument '--exec-batch <cmd>...' cannot be used with '--exec <cmd>...'",1814+ "error: the argument '--exec-batch <cmd>...' cannot be used with '--exec <cmd>...'\n\1815+ \n\1816+ Usage: fd --exec-batch <cmd>... <pattern> [path]...\n\1817+ \n\1818+ For more information, try '--help'.\n\1819+ ",1820 );1821 1822 te.assert_failure_with_error(1823 &["foo", "--exec-batch"],1819- "error: The argument '--exec-batch <cmd>...' requires a value but none was supplied",1824+ "error: a value is required for '--exec-batch <cmd>...' but none was supplied\n\1825+ \n\1826+ For more information, try '--help'.\n\1827+ ",1828 );1829 1830 te.assert_failure_with_error(1831 &["foo", "--exec-batch", "echo {}"],1832 "error: First argument of exec-batch is expected to be a fixed executable\n\1833 \n\1834 Usage: fd [OPTIONS] [pattern] [path]...\n\1835 \n\1828- For more information try '--help'\n\1836+ For more information, try '--help'.\n\1837 ",1838 );1839 1840 te.assert_failure_with_error(&["a.foo", "--exec-batch", "bash", "-c", "exit 1"], "");711 unmodified linesmodified:build.rs+1 added-1 removed
1 fn main() {2- let min_version = "1.60";2+ let min_version = "1.64";3 4 match version_check::is_min_version(min_version) {5 Some(true) => {}6 // rustc version too small or can't figure it out6 unmodified linesmodified:Cargo.lock+50 added-8 removed
99 unmodified lines100 ]101 102 [[package]]103 name = "clap"104-version = "4.0.22"104+version = "4.1.1"105 source = "registry+https://github.com/rust-lang/crates.io-index"106-checksum = "91b9970d7505127a162fdaa9b96428d28a479ba78c9ec7550a63a5d9863db682"106+checksum = "4ec7a4128863c188deefe750ac1d1dfe66c236909f845af04beed823638dc1b2"107 dependencies = [108- "atty",108 "bitflags",109 "clap_derive",110 "clap_lex",111+ "is-terminal",112 "once_cell",113 "strsim",114 "termcolor",115 "terminal_size",9 unmodified lines125 ]126 127 [[package]]128 name = "clap_derive"129-version = "4.0.21"129+version = "4.1.0"130 source = "registry+https://github.com/rust-lang/crates.io-index"131-checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014"131+checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8"132 dependencies = [133 "heck",134 "proc-macro-error",135 "proc-macro2",337 unmodified lines473 source = "registry+https://github.com/rust-lang/crates.io-index"474 checksum = "e6e481ccbe3dea62107216d0d1138bb8ad8e5e5c43009a098bd1990272c497b0"475 476 [[package]]477+name = "io-lifetimes"478+version = "1.0.4"479+source = "registry+https://github.com/rust-lang/crates.io-index"480+checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e"481+dependencies = [482+ "libc",483+ "windows-sys 0.42.0",484+]485+486+[[package]]487+name = "is-terminal"488+version = "0.4.2"489+source = "registry+https://github.com/rust-lang/crates.io-index"490+checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"491+dependencies = [492+ "hermit-abi 0.2.6",493+ "io-lifetimes 1.0.4",494+ "rustix 0.36.6",495+ "windows-sys 0.42.0",496+]497+498+[[package]]499 name = "jemalloc-sys"500 version = "0.5.2+5.3.0-patched"501 source = "registry+https://github.com/rust-lang/crates.io-index"502 checksum = "134163979b6eed9564c98637b710b40979939ba351f59952708234ea11b5f3f8"49 unmodified lines552 source = "registry+https://github.com/rust-lang/crates.io-index"553 checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d"554 555 [[package]]556+name = "linux-raw-sys"557+version = "0.1.4"558+source = "registry+https://github.com/rust-lang/crates.io-index"559+checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"560+561+[[package]]562 name = "log"563 version = "0.4.17"564 source = "registry+https://github.com/rust-lang/crates.io-index"565 checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"212 unmodified lines778 checksum = "985947f9b6423159c4726323f373be0a21bdb514c5af06a849cb3d2dce2d01e8"779 dependencies = [780 "bitflags",781 "errno",754- "io-lifetimes",782+ "io-lifetimes 0.7.4",783 "libc",756- "linux-raw-sys",784+ "linux-raw-sys 0.0.46",785 "windows-sys 0.36.1",786 ]787 788 [[package]]789+name = "rustix"790+version = "0.36.6"791+source = "registry+https://github.com/rust-lang/crates.io-index"792+checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549"793+dependencies = [794+ "bitflags",795+ "errno",796+ "io-lifetimes 1.0.4",797+ "libc",798+ "linux-raw-sys 0.1.4",799+ "windows-sys 0.42.0",800+]801+802+[[package]]803 name = "same-file"804 version = "1.0.6"805 source = "registry+https://github.com/rust-lang/crates.io-index"806 checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"58 unmodified lines865 version = "0.2.1"866 source = "registry+https://github.com/rust-lang/crates.io-index"867 checksum = "8440c860cf79def6164e4a0a983bcc2305d82419177a0e0c71930d049e3ac5a1"868 dependencies = [827- "rustix",869+ "rustix 0.35.12",870 "windows-sys 0.36.1",871 ]872 873 [[package]]279 unmodified linesmodified:Cargo.toml+2 added-1 removed
16 unmodified lines17181920212223242526 unmodified lines5253545555565758596036 unmodified lines16 unmodified linesreadme = "README.md"repository = "https://github.com/sharkdp/fd"version = "8.6.0"edition= "2021"rust-version = "1.64.0"
[badges.appveyor]repository = "sharkdp/fd"
26 unmodified linesclap_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]version = "0.4.23"36 unmodified linesmodified:clippy.toml+1 added-1 removed
11msrv = "1.60.0"msrv = "1.64.0"