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
3 changed files with 22 additions and 3 deletions

View File

@ -175,6 +175,25 @@ impl Command for SubCommand {
],
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()
)),
}
]
}