Skip to content

Commit 8cfb327

Browse files
authored
cut: improve some error messages (#11338)
1 parent d66817f commit 8cfb327

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/uu/cut/locales/en-US.ftl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ cut-error-delimiter-and-whitespace-conflict = invalid input: Only one of --delim
109109
cut-error-delimiter-must-be-single-character = the delimiter must be a single character
110110
cut-error-multiple-mode-args = invalid usage: expects no more than one of --fields (-f), --chars (-c) or --bytes (-b)
111111
cut-error-missing-mode-arg = invalid usage: expects one of --fields (-f), --chars (-c) or --bytes (-b)
112-
cut-error-delimiter-only-with-fields = invalid input: The '--delimiter' ('-d') option only usable if printing a sequence of fields
113-
cut-error-whitespace-only-with-fields = invalid input: The '-w' option only usable if printing a sequence of fields
114-
cut-error-only-delimited-only-with-fields = invalid input: The '--only-delimited' ('-s') option only usable if printing a sequence of fields
112+
cut-error-delimiter-only-with-fields = invalid input: The '--delimiter' ('-d') option can only be used when printing a sequence of fields
113+
cut-error-whitespace-only-with-fields = invalid input: The '-w' option can only be used when printing a sequence of fields
114+
cut-error-only-delimited-only-with-fields = invalid input: The '--only-delimited' ('-s') option can only be used when printing a sequence of fields

tests/by-util/test_cut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fn test_delimiter_with_byte_and_char() {
131131
new_ucmd!()
132132
.args(&[conflicting_arg, COMPLEX_SEQUENCE.sequence, "-d="])
133133
.fails_with_code(1)
134-
.stderr_is("cut: invalid input: The '--delimiter' ('-d') option only usable if printing a sequence of fields\n")
134+
.stderr_is("cut: invalid input: The '--delimiter' ('-d') option can only be used when printing a sequence of fields\n")
135135
;
136136
}
137137
}

util/gnu-patches/tests_cut_error_msg.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Index: gnu/tests/cut/cut.pl
2121
+my $inval_fld = "$prog: range '--' was invalid: failed to parse range\n";
2222
+my $inval_pos = "$prog: range '--' was invalid: failed to parse range\n";
2323
+my $no_endpoint = "$prog: range '-' was invalid: invalid range with no endpoint\n";
24-
+my $nofield = "$prog: invalid input: The '--delimiter' ('-d') option only usable if printing a sequence of fields\n";
24+
+my $nofield = "$prog: invalid input: The '--delimiter' ('-d') option can only be used when printing a sequence of fields\n";
2525

2626
my @Tests =
2727
(
@@ -53,7 +53,7 @@ Index: gnu/tests/cut/cut.pl
5353
['y', qw(-s -b4), {IN=>":\n"}, {OUT=>""}, {EXIT=>1},
5454
- {ERR=>"$prog: suppressing non-delimited lines makes sense\n"
5555
- . "\tonly when operating on fields\n$try"}],
56-
+ {ERR=>"$prog: invalid input: The '--only-delimited' ('-s') option only usable if printing a sequence of fields\n"}],
56+
+ {ERR=>"$prog: invalid input: The '--only-delimited' ('-s') option can only be used when printing a sequence of fields\n"}],
5757
# You must specify bytes or fields (or chars)
5858
['z', '', {IN=>":\n"}, {OUT=>""}, {EXIT=>1},
5959
- {ERR=>"$prog: you must specify a list of bytes, characters, or fields\n$try"}

0 commit comments

Comments
 (0)