aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2024-12-16 00:51:31 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2024-12-16 00:53:51 +0100
commitee8b94acbf9ac9a6a48831a244cfef897affe82e (patch)
treeac10d490acd53ecdf468fb2f6100987b94c23bc8
parent0bd84c94720b5a68d97c05975220e6482c455623 (diff)
downloadbusybox-w32-ee8b94acbf9ac9a6a48831a244cfef897affe82e.tar.gz
busybox-w32-ee8b94acbf9ac9a6a48831a244cfef897affe82e.tar.bz2
busybox-w32-ee8b94acbf9ac9a6a48831a244cfef897affe82e.zip
cut: shorten error messages on bad syntax
We don't need to mimic GNU cut error messages. $ cut -d@ -b3 cut: -d DELIM makes sense only with -f or -F $ cut -s -b3 cut: -s makes sense only with -f or -F function old new delta static._op_on_field 31 32 +1 .rodata 105659 105598 -61 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 1/-61) Total: -60 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/cut.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 0913c4b68..af2fd9fd4 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -330,15 +330,15 @@ int cut_main(int argc UNUSED_PARAM, char **argv)
330 330
331 /* non-field (char or byte) cutting has some special handling */ 331 /* non-field (char or byte) cutting has some special handling */
332 if (!(opt & (OPT_FIELDS|OPT_REGEX))) { 332 if (!(opt & (OPT_FIELDS|OPT_REGEX))) {
333 static const char _op_on_field[] ALIGN1 = " only when operating on fields"; 333 static const char _op_on_field[] ALIGN1 = " makes sense only with -f"IF_FEATURE_CUT_REGEX(" or -F");
334 334
335 if (opt & OPT_SUPPRESS) { 335 if (opt & OPT_SUPPRESS) {
336 bb_error_msg_and_die 336 bb_error_msg_and_die
337 ("suppressing non-delimited lines makes sense%s", _op_on_field); 337 ("-s%s", _op_on_field);
338 } 338 }
339 if (opt & OPT_DELIM) { 339 if (opt & OPT_DELIM) {
340 bb_error_msg_and_die 340 bb_error_msg_and_die
341 ("a delimiter may be specified%s", _op_on_field); 341 ("-d DELIM%s", _op_on_field);
342 } 342 }
343 } 343 }
344 344