/[pcre]/code/tags/pcre-3.2/pgrep.c
ViewVC logotype

Diff of /code/tags/pcre-3.2/pgrep.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

code/trunk/pgrep.c revision 35 by nigel, Sat Feb 24 21:39:05 2007 UTC code/tags/pcre-3.2/pgrep.c revision 48 by nigel, Sat Feb 24 21:39:31 2007 UTC
# Line 6  Line 6 
6  #include <string.h>  #include <string.h>
7  #include <stdlib.h>  #include <stdlib.h>
8  #include <errno.h>  #include <errno.h>
9    #include "config.h"
10  #include "pcre.h"  #include "pcre.h"
11    
   
12  #define FALSE 0  #define FALSE 0
13  #define TRUE 1  #define TRUE 1
14    
# Line 32  static BOOL whole_lines = FALSE; Line 32  static BOOL whole_lines = FALSE;
32    
33    
34    
35  #ifdef STRERROR_FROM_ERRLIST  #if ! HAVE_STRERROR
36  /*************************************************  /*************************************************
37  *     Provide strerror() for non-ANSI libraries  *  *     Provide strerror() for non-ANSI libraries  *
38  *************************************************/  *************************************************/
# Line 50  strerror(int n) Line 50  strerror(int n)
50  if (n < 0 || n >= sys_nerr) return "unknown error number";  if (n < 0 || n >= sys_nerr) return "unknown error number";
51  return sys_errlist[n];  return sys_errlist[n];
52  }  }
53  #endif /* STRERROR_FROM_ERRLIST */  #endif /* HAVE_STRERROR */
54    
55    
56    
# Line 119  return rc; Line 119  return rc;
119  static int  static int
120  usage(int rc)  usage(int rc)
121  {  {
122  fprintf(stderr, "Usage: pgrep [-chilnsvx] pattern [file] ...\n");  fprintf(stderr, "Usage: pgrep [-Vchilnsvx] pattern [file] ...\n");
123  return rc;  return rc;
124  }  }
125    
# Line 159  for (i = 1; i < argc; i++) Line 159  for (i = 1; i < argc; i++)
159        case 's': silent = TRUE; break;        case 's': silent = TRUE; break;
160        case 'v': invert = TRUE; break;        case 'v': invert = TRUE; break;
161        case 'x': whole_lines = TRUE; options |= PCRE_ANCHORED; break;        case 'x': whole_lines = TRUE; options |= PCRE_ANCHORED; break;
162    
163          case 'V':
164          fprintf(stderr, "PCRE version %s\n", pcre_version());
165          break;
166    
167        default:        default:
168        fprintf(stderr, "pgrep: unknown option %c\n", s[-1]);        fprintf(stderr, "pgrep: unknown option %c\n", s[-1]);
169        return usage(2);        return usage(2);

Legend:
Removed from v.35  
changed lines
  Added in v.48

  ViewVC Help
Powered by ViewVC 1.1.5