1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-16 18:21:01 +00:00

cut: add test & improve error message

This commit is contained in:
Daniel Hofstetter 2023-11-29 09:35:22 +01:00
parent 08998c0e40
commit 6eec4fe8f9
2 changed files with 11 additions and 2 deletions

View file

@ -426,7 +426,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
delim = "";
}
if delim.chars().count() > 1 {
Err("invalid input: The '--delimiter' ('-d') option expects empty or 1 character long, but was provided a value 2 characters or longer".into())
Err("the delimiter must be a single character".into())
} else {
let delim = if delim.is_empty() {
"\0".to_owned()