diff --git a/strings.1 b/strings.1 index 3d8cdff..c930089 100644 --- a/strings.1 +++ b/strings.1 @@ -1,10 +1,13 @@ -.TH STRINGS 1 sbase\-VERSION -.SH NAME -strings \- print the strings of printable characters in files -.SH SYNOPSIS -.B strings -.IR file... -.SH DESCRIPTION -.B strings +.Dd November 23, 2014 +.Dt STRINGS 1 sbase\-VERSION +.Os +.Sh NAME +.Nm strings +.Nd print the strings of pritable characters in files +.Sh SYNOPSIS +.Nm strings +.Op Ar file ... +.Sh DESCRIPTION +.Nm prints the printable character sequences that are at least 6 characters long. If no files are given then it uses stdin. diff --git a/strings.c b/strings.c index f4775ed..8f071c2 100644 --- a/strings.c +++ b/strings.c @@ -10,13 +10,14 @@ static void dostrings(FILE *fp, const char *fname); static void usage(void) { - eprintf("usage: %s file...\n", argv0); + eprintf("usage: %s [file ...]\n", argv0); } int main(int argc, char *argv[]) { FILE *fp; + int ret = 0; ARGBEGIN { default: @@ -29,14 +30,14 @@ main(int argc, char *argv[]) for (; argc > 0; argc--, argv++) { if (!(fp = fopen(argv[0], "r"))) { weprintf("fopen %s:", argv[0]); + ret = 1; continue; } dostrings(fp, argv[0]); fclose(fp); } } - - return 0; + return ret; } static void