Mercurial > hg > toybox
annotate toys/posix/cat.c @ 1776:7bf68329eb3b draft default tip
Repository switched to git at https://github.com/landley/toybox
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 09 Apr 2015 02:28:32 -0500 |
parents | 03c426368470 |
children |
rev | line source |
---|---|
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
1 /* cat.c - copy inputs to stdout. |
279
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 * |
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 * Copyright 2006 Rob Landley <rob@landley.net> |
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 * |
656
6df4ccc0acbe
Regularize command headers, update links to standards documents.
Rob Landley <rob@landley.net>
parents:
653
diff
changeset
|
5 * See http://opengroup.org/onlinepubs/9699919799/utilities/cat.html |
1623
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
6 * |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
7 * And "Cat -v considered harmful" at |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
8 * http://cm.bell-labs.com/cm/cs/doc/84/kp.ps.gz |
279
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 |
1623
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
10 USE_CAT(NEWTOY(cat, "u"USE_CAT_V("vte"), TOYFLAG_BIN)) |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
11 #USE_CATV(NEWTOY(catv, USE_CATV("vte"), TOYFLAG_USR|TOYFLAG_BIN)) |
279
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
12 |
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 config CAT |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
14 bool "cat" |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
15 default y |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
16 help |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
17 usage: cat [-u] [file...] |
1333
fc1bb49e58a9
Help text should have a blank line after usage: lines, and a couple other whitespace tweaks.
Rob Landley <rob@landley.net>
parents:
780
diff
changeset
|
18 |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
19 Copy (concatenate) files to stdout. If no files listed, copy from stdin. |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
20 Filename "-" is a synonym for stdin. |
279
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
22 -u Copy one byte at a time (slow). |
1623
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
23 |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
24 config CAT_V |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
25 bool "cat -etv" |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
26 default y |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
27 depends on CAT |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
28 help |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
29 usage: cat [-evt] |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
30 |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
31 -e Mark each newline with $ |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
32 -t Show tabs as ^I |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
33 -v Display nonprinting characters as escape sequences. Use M-x for |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
34 high ascii characters (>127), and ^x for other nonprinting chars. |
279
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 */ |
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 |
1623
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
37 /* |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
38 todo: |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
39 |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
40 config CATV |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
41 bool "catv" |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
42 default y |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
43 depends on !CAT_V |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
44 help |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
45 usage: catv [-evt] [filename...] |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
46 |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
47 Display nonprinting characters as escape sequences. Use M-x for |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
48 high ascii characters (>127), and ^x for other nonprinting chars. |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
49 |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
50 -e Mark each newline with $ |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
51 -t Show tabs as ^I |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
52 -v Don't use ^x or M-x escapes. |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
53 */ |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
54 |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
55 #define FOR_cat |
279
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
56 #include "toys.h" |
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
57 |
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
58 static void do_cat(int fd, char *name) |
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
59 { |
1623
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
60 int i, len, size=(toys.optflags & FLAG_u) ? 1 : sizeof(toybuf); |
279
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
61 |
1623
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
62 for(;;) { |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
63 len = read(fd, toybuf, size); |
1623
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
64 if (len < 0) toys.exitval = EXIT_FAILURE; |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
65 if (len < 1) break; |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
66 if (CFG_CAT_V && (toys.optflags&~FLAG_u)) { |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
67 for (i=0; i<len; i++) { |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
68 char c=toybuf[i]; |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
69 |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
70 if (c > 126 && (toys.optflags & FLAG_v)) { |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
71 if (c > 127) { |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
72 printf("M-"); |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
73 c -= 128; |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
74 } |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
75 if (c == 127) { |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
76 printf("^?"); |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
77 continue; |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
78 } |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
79 } |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
80 if (c < 32) { |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
81 if (c == 10) { |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
82 if (toys.optflags & FLAG_e) xputc('$'); |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
83 } else if (toys.optflags & (c==9 ? FLAG_t : FLAG_v)) { |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
84 printf("^%c", c+'@'); |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
85 continue; |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
86 } |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
87 } |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
88 xputc(c); |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
89 } |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
90 } else xwrite(1, toybuf, len); |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
91 } |
279
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
92 } |
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
93 |
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
94 void cat_main(void) |
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
95 { |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
656
diff
changeset
|
96 loopfiles(toys.optargs, do_cat); |
279
0ca2fcee572b
Spent the five minutes to implement "cat".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
97 } |
1623
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
98 |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
99 //todo: |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
100 //void catv_main(void) |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
101 //{ |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
102 // toys.optflags ^= FLAG_v; |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
103 // loopfiles(toys.optargs, do_catv); |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
104 //} |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
105 |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
106 // The common infrastructure is testing FLAG_h which is only defined in cat |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
107 // context (not catv), but catv can't use cat's flag context if cat is disabled |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
108 // and its flags are zero. Need to upgrade flag parsing infrastructure so |
f67b1e9e91b4
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Rob Landley <rob@landley.net>
parents:
1333
diff
changeset
|
109 // defining FORCE_FLAGS along with FOR_command doesn't zero unused flag macros. |