mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
comm: permit and test separators that contain a hyphen
This commit is contained in:
parent
dcb53b6c99
commit
1fa0b032e5
4 changed files with 23 additions and 0 deletions
|
@ -186,6 +186,7 @@ pub fn uu_app() -> Command {
|
||||||
.help("separate columns with STR")
|
.help("separate columns with STR")
|
||||||
.value_name("STR")
|
.value_name("STR")
|
||||||
.default_value(options::DELIMITER_DEFAULT)
|
.default_value(options::DELIMITER_DEFAULT)
|
||||||
|
.allow_hyphen_values(true)
|
||||||
.hide_default_value(true),
|
.hide_default_value(true),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
|
|
@ -91,6 +91,22 @@ fn output_delimiter() {
|
||||||
.stdout_only_fixture("ab_delimiter_word.expected");
|
.stdout_only_fixture("ab_delimiter_word.expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn output_delimiter_hyphen_one() {
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["--output-delimiter", "-1", "a", "b"])
|
||||||
|
.succeeds()
|
||||||
|
.stdout_only_fixture("ab_delimiter_hyphen_one.expected");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn output_delimiter_hyphen_help() {
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["--output-delimiter", "--help", "a", "b"])
|
||||||
|
.succeeds()
|
||||||
|
.stdout_only_fixture("ab_delimiter_hyphen_help.expected");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn output_delimiter_nul() {
|
fn output_delimiter_nul() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
|
|
3
tests/fixtures/comm/ab_delimiter_hyphen_help.expected
vendored
Normal file
3
tests/fixtures/comm/ab_delimiter_hyphen_help.expected
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
a
|
||||||
|
--helpb
|
||||||
|
--help--helpz
|
3
tests/fixtures/comm/ab_delimiter_hyphen_one.expected
vendored
Normal file
3
tests/fixtures/comm/ab_delimiter_hyphen_one.expected
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
a
|
||||||
|
-1b
|
||||||
|
-1-1z
|
Loading…
Add table
Add a link
Reference in a new issue