mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 14:52:41 +00:00
numfmt: allow hyphen values for --field option
This commit is contained in:
parent
4b2138e61e
commit
3a8feedf2d
2 changed files with 9 additions and 0 deletions
|
@ -275,6 +275,7 @@ pub fn uu_app() -> Command {
|
|||
.long(options::FIELD)
|
||||
.help("replace the numbers in these input fields; see FIELDS below")
|
||||
.value_name("FIELDS")
|
||||
.allow_hyphen_values(true)
|
||||
.default_value(options::FIELD_DEFAULT),
|
||||
)
|
||||
.arg(
|
||||
|
|
|
@ -375,6 +375,14 @@ fn test_format_selected_fields() {
|
|||
.stdout_only("1000 2K 3000 4000 5K 6K\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_format_implied_range_and_field() {
|
||||
new_ucmd!()
|
||||
.args(&["--from=auto", "--field", "-2,4", "1K 2K 3K 4K 5K 6K"])
|
||||
.succeeds()
|
||||
.stdout_only("1000 2000 3K 4000 5K 6K\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_should_succeed_if_selected_field_out_of_range() {
|
||||
new_ucmd!()
|
||||
|
|
Loading…
Reference in a new issue