Feature+: Bracoxide Zero Padding for Numeric Ranges (#15125)

adds feature spécified in bracoxide#6

```
$ echo {01..10} 
01 02 03 04 05 06 07 08 09 10
$ echo {1..010} 
001 002 003 004 005 006 007 008 009 010
```

I'm going to update the examples, but I'm currently on mobile. Will land
in a couple of days.
This commit is contained in:
A. Taha Baki 2025-02-19 16:35:10 +03:00 committed by GitHub
parent f8ac9db15b
commit 8b46ba8b6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 3 deletions

4
Cargo.lock generated
View File

@ -752,9 +752,9 @@ dependencies = [
[[package]] [[package]]
name = "bracoxide" name = "bracoxide"
version = "0.1.4" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbc0bcb5424e8e1f29c21a00f2d222df5e8e9779732ff03f840315d8fbac708e" checksum = "7f52991c481aa9d7518254cfb6ce5726d24ff8c5d383d6422cd3793729b0962a"
[[package]] [[package]]
name = "brotli" name = "brotli"

View File

@ -66,7 +66,7 @@ alphanumeric-sort = "1.5"
ansi-str = "0.8" ansi-str = "0.8"
anyhow = "1.0.82" anyhow = "1.0.82"
base64 = "0.22.1" base64 = "0.22.1"
bracoxide = "0.1.4" bracoxide = "0.1.5"
brotli = "7.0" brotli = "7.0"
byteorder = "1.5" byteorder = "1.5"
bytes = "1" bytes = "1"

View File

@ -175,6 +175,25 @@ impl Command for SubCommand {
], ],
Span::test_data() Span::test_data()
)), )),
},
Example {
description: "Supports zero padding in numeric ranges.",
example: "\"A{08..10}B{11..013}C\" | str expand",
result: Some(Value::list(
vec![
Value::test_string("A08B011C"),
Value::test_string("A08B012C"),
Value::test_string("A08B013C"),
Value::test_string("A09B011C"),
Value::test_string("A09B012C"),
Value::test_string("A09B013C"),
Value::test_string("A10B011C"),
Value::test_string("A10B012C"),
Value::test_string("A10B013C"),
],
Span::test_data()
)),
} }
] ]
} }