From 2ffd8986e21f1782c78e1a9d34f6042af53d876c Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 16 Apr 2023 08:23:58 +0100 Subject: tr: display usage for incorrect arguments tr must have one or two non-option arguments. Display the usage message if any other number is present. function old new delta .rodata 108389 108392 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 3/0) Total: 3 bytes Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- coreutils/tr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coreutils') diff --git a/coreutils/tr.c b/coreutils/tr.c index 1e402dfdb..7fe7f89d5 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c @@ -299,7 +299,7 @@ int tr_main(int argc UNUSED_PARAM, char **argv) */ /* '+': stop at first non-option */ - opts = getopt32(argv, "^+" "Ccds" "\0" "-1"); + opts = getopt32(argv, "^+" "Ccds" "\0" "-1:?2"); argv += optind; str1_length = expand(*argv++, &str1); -- cgit v1.2.3