Changeset 4289
- Timestamp:
- Jan 21, 2010, 2:17:21 AM (11 years ago)
- Location:
- zzuf/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/doc/zzcat.1.in
r4278 r4289 3 3 zzcat \- concatenate files using different instruction sequences 4 4 .SH SYNOPSIS 5 \fBzzcat\fR [\fB\-Ab eEntTv\fR] [\fB\-r\fR \fIloops\fR]5 \fBzzcat\fR [\fB\-AbdeEntTv\fR] [\fB\-r\fR \fIloops\fR] 6 6 [\fB\-x\fR \fIsequence\fR] [\fIFILE\fR]... 7 7 .br … … 26 26 \fB\-b\fR, \fB\-\-number\-nonblank\fR 27 27 Number nonempty output lines. 28 .TP 29 \fB\-d\fR, \fB\-\-debug\fR 30 Output debugging information. 28 31 .TP 29 32 \fB\-e\fR -
zzuf/trunk/src/zzcat.c
r4288 r4289 65 65 66 66 /* Global parameters */ 67 static int debug = 0; 67 68 static int repeat = 1; 68 69 static char escape_tabs = 0; … … 89 90 for (;;) 90 91 { 91 #define OPTSTR "+Ab eEnr:stTvx:lhV"92 #define OPTSTR "+AbdeEnr:stTvx:lhV" 92 93 #define MOREINFO "Try `%s --help' for more information.\n" 93 94 int option_index = 0; … … 96 97 { "show-all", 0, NULL, 'A' }, 97 98 { "number-nonblank", 0, NULL, 'b' }, 99 { "debug", 0, NULL, 'd' }, 98 100 { "show-ends", 0, NULL, 'E' }, 99 101 { "number", 0, NULL, 'n' }, … … 120 122 case 'b': /* --number-nonblank */ 121 123 number_nonblank = 1; 124 break; 125 case 'd': /* --debug */ 126 debug = 1; 122 127 break; 123 128 case 'e': … … 278 283 retlen = retoff + _cnt; \ 279 284 if (!retbuf || ROUNDUP(retlen) != ROUNDUP(retlen - _cnt)) \ 285 { \ 286 if (debug) \ 287 fprintf(stderr, "D: zzcat: allocating %i bytes for %i\n", \ 288 (int)ROUNDUP(retlen), (int)retlen); \ 280 289 retbuf = realloc(retbuf, ROUNDUP(retlen)); \ 290 } \ 281 291 } \ 282 292 if (_cnt > 0) \ 293 { \ 294 if (debug) \ 295 fprintf(stderr, "D: zzcat: writing %i byte%s at offset %i\n", \ 296 (int)_cnt, _cnt == 1 ? "" : "s", (int)retoff); \ 283 297 memcpy(retbuf + retoff, address, _cnt); \ 298 } \ 284 299 retoff += _off; \ 285 300 } while(0) … … 785 800 static void usage(void) 786 801 { 787 printf("Usage: zzcat [Ab eEntTv] [-x sequence] [FILE...]\n");802 printf("Usage: zzcat [AbdeEntTv] [-x sequence] [FILE...]\n"); 788 803 printf(" zzcat -l | --list\n"); 789 804 printf(" zzcat -h | --help\n"); … … 794 809 printf(" -A, --show-all equivalent to -vET\n"); 795 810 printf(" -b, --number-nonblank number nonempty output lines\n"); 811 printf(" -d, --debug print debugging information\n"); 796 812 printf(" -e equivalent to -vE\n"); 797 813 printf(" -E, --show-ends display $ at end of each line\n");
Note: See TracChangeset
for help on using the changeset viewer.