=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/grep/grep.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- src/usr.bin/grep/grep.c 2011/03/04 03:11:23 1.43 +++ src/usr.bin/grep/grep.c 2011/07/08 01:20:24 1.44 @@ -1,4 +1,4 @@ -/* $OpenBSD: grep.c,v 1.43 2011/03/04 03:11:23 tedu Exp $ */ +/* $OpenBSD: grep.c,v 1.44 2011/07/08 01:20:24 tedu Exp $ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav @@ -74,6 +74,7 @@ int iflag; /* -i: ignore case */ int lflag; /* -l: only show names of files with matches */ int nflag; /* -n: show line numbers in front of matching lines */ +int oflag; /* -o: print each match */ int qflag; /* -q: quiet mode (don't output anything) */ int sflag; /* -s: silent mode (ignore errors) */ int vflag; /* -v: only show non-matching lines */ @@ -107,9 +108,9 @@ { fprintf(stderr, #ifdef NOZ - "usage: %s [-abcEFGHhIiLlnqRsUVvwx] [-A num] [-B num] [-C[num]]\n" + "usage: %s [-abcEFGHhIiLlnoqRsUVvwx] [-A num] [-B num] [-C[num]]\n" #else - "usage: %s [-abcEFGHhIiLlnqRsUVvwxZ] [-A num] [-B num] [-C[num]]\n" + "usage: %s [-abcEFGHhIiLlnoqRsUVvwxZ] [-A num] [-B num] [-C[num]]\n" #endif "\t[-e pattern] [-f file] [--binary-files=value] [--context[=num]]\n" "\t[--line-buffered] [pattern] [file ...]\n", __progname); @@ -117,9 +118,9 @@ } #ifdef NOZ -static char *optstr = "0123456789A:B:CEFGHILRUVabce:f:hilnqrsuvwxy"; +static char *optstr = "0123456789A:B:CEFGHILRUVabce:f:hilnoqrsuvwxy"; #else -static char *optstr = "0123456789A:B:CEFGHILRUVZabce:f:hilnqrsuvwxy"; +static char *optstr = "0123456789A:B:CEFGHILRUVZabce:f:hilnoqrsuvwxy"; #endif struct option long_options[] = @@ -382,6 +383,9 @@ break; case 'n': nflag = 1; + break; + case 'o': + oflag = 1; break; case 'q': qflag = 1;