commit c369844ae248279b3c2e2edec568311e476ccfb2
parent eb57becb38526404c5bcea20bcb498a9ddb0a218
Author: FRIGN <dev@frign.de>
Date: Sat, 24 Jan 2015 22:53:37 +0100
Refactor cut.1 and cut.c
and reflect recent changes to the role of "delim".
Diffstat:
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/cut.1 b/cut.1
@@ -53,9 +53,9 @@ delimiters are passed through, unless
.Fl s
is specified.
.It Fl d Ar delim
-Use first byte of
+Use
.Ar delim
-as field delimiter. Default is \et.
+as field delimiter, which can be an arbitrary string. Default is '\et'.
.It Fl s
Suppress lines not containing field delimiters.
.El
diff --git a/cut.c b/cut.c
@@ -158,8 +158,11 @@ resolveescapes(char *s, size_t len)
case 'r': s[i] = '\r'; off++; break;
case 't': s[i] = '\t'; off++; break;
case 'v': s[i] = '\v'; off++; break;
- case '\0': eprintf("cut: null escape sequence in delimiter\n");
- default: eprintf("cut: invalid escape sequence '\\%c' in delimiter\n", s[i + 1]);
+ case '\0':
+ eprintf("cut: null escape sequence in delimiter\n");
+ default:
+ eprintf("cut: invalid escape sequence '\\%c' in"
+ "delimiter\n", s[i + 1]);
}
for (m = i + 1; m <= len - off; m++)