mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 14:52:41 +00:00
Merge pull request #4090 from cakebaker/numfmt_field_range_14_15
numfmt: allow hyphen values for --field option
This commit is contained in:
commit
44cded6c06
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