version 1.9, 2003/06/10 22:20:47 |
version 1.10, 2003/12/09 00:55:18 |
|
|
morefiles++; |
morefiles++; |
if (*p == '-') |
if (*p == '-') |
ip->fp = stdin; |
ip->fp = stdin; |
else if ((ip->fp = fopen(p, "r")) == NULL) { |
else if ((ip->fp = fopen(p, "r")) == NULL) |
perror(p); |
err(1, p); |
exit(1); |
|
} |
|
ip->pad = P; |
ip->pad = P; |
if (!ip->sepstring) |
if (!ip->sepstring) |
ip->sepstring = (S ? (ip-1)->sepstring : ""); |
ip->sepstring = (S ? (ip-1)->sepstring : ""); |
|
|
void |
void |
error(char *msg, char *s) |
error(char *msg, char *s) |
{ |
{ |
fprintf(stderr, "lam: "); |
extern char *__progname; |
fprintf(stderr, msg, s); |
warnx(msg, s); |
fprintf(stderr, |
fprintf(stderr, |
"\nUsage: lam [ -[fp] min.max ] [ -s sepstring ] [ -t c ] file ...\n"); |
"Usage: %s [ -[fp] min.max ] [ -s sepstring ] [ -t c ] file ...\n", |
|
__progname); |
if (strncmp("lam - ", msg, 6) == 0) |
if (strncmp("lam - ", msg, 6) == 0) |
fprintf(stderr, "Options:\n\t%s\t%s\t%s\t%s\t%s", |
fprintf(stderr, "Options:\n" |
"-f min.max field widths for file fragments\n", |
"\t-f min.max\tfield widths for file fragments\n" |
"-p min.max like -f, but pad missing fragments\n", |
"\t-p min.max\tlike -f, but pad missing fragments\n" |
"-s sepstring fragment separator\n", |
"\t-s sepstring\tfragment separator\n" |
"-t c input line terminator is c, no \\n after output lines\n", |
"\t-t c\t\tinput line terminator is c, no \\n after output lines\n" |
"Capitalized options affect more than one file.\n"); |
"\tCapitalized options affect more than one file.\n"); |
exit(1); |
exit(1); |
} |
} |