logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git
commit: 266415d38454b752ed2e1bee0c91f34ac2a05d38
parent 565aab8157ae1c14c28b193eef34d26c6e42bb4d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 20 Sep 2024 17:04:16 +0200

cmd/cut: handle unknown option

Diffstat:

Mcmd/cut.c5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cmd/cut.c b/cmd/cut.c @@ -426,9 +426,12 @@ main(int argc, char *argv[]) case ':': fprintf(stderr, "%s: error: Option '-%c' requires an operand\n", argv0, optopt); return 1; - default: + case '?': fprintf(stderr, "%s: error: Unhandled option '-%c'\n", argv0, optopt); return 1; + default: + fprintf(stderr, "%s: error: Unhandled getopt case '%c'\n", argv0, c); + abort(); } }