diff options
| author | David M. Syzdek <syzdek@bindlebinaries.com> | 2012-06-04 16:47:29 -0800 |
|---|---|---|
| committer | David M. Syzdek <syzdek@bindlebinaries.com> | 2012-06-04 16:47:29 -0800 |
| commit | 626f15f3c1ca84fdd8c81302872421cf1d292282 (patch) | |
| tree | 195c54269aad7e1d988dafc483c7af9739143471 /src/posixregex.c | |
| parent | 57278749ec2e574598e049694b26ae76ad54c3d1 (diff) | |
| download | dmstools-626f15f3c1ca84fdd8c81302872421cf1d292282.tar.gz dmstools-626f15f3c1ca84fdd8c81302872421cf1d292282.tar.bz2 dmstools-626f15f3c1ca84fdd8c81302872421cf1d292282.tar.xz dmstools-626f15f3c1ca84fdd8c81302872421cf1d292282.zip | |
Adding ability to toggle "basic" regular expressions.
Diffstat (limited to 'src/posixregex.c')
| -rw-r--r-- | src/posixregex.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/posixregex.c b/src/posixregex.c index c0addfe..08e3faa 100644 --- a/src/posixregex.c +++ b/src/posixregex.c | |||
| @@ -206,7 +206,7 @@ int main(int argc, char * argv[]) | |||
| 206 | } opt; | 206 | } opt; |
| 207 | 207 | ||
| 208 | // getopt options | 208 | // getopt options |
| 209 | static char short_opt[] = "hipqr:svV"; | 209 | static char short_opt[] = "bhipqr:svV"; |
| 210 | static struct option long_opt[] = | 210 | static struct option long_opt[] = |
| 211 | { | 211 | { |
| 212 | {"help", no_argument, 0, 'h'}, | 212 | {"help", no_argument, 0, 'h'}, |
| @@ -232,6 +232,9 @@ int main(int argc, char * argv[]) | |||
| 232 | case -1: // no more arguments | 232 | case -1: // no more arguments |
| 233 | case 0: // long options toggles | 233 | case 0: // long options toggles |
| 234 | break; | 234 | break; |
| 235 | case 'b': | ||
| 236 | opt.reg_cflags = opt.reg_cflags & (~REG_EXTENDED); | ||
| 237 | break; | ||
| 235 | case 'h': | 238 | case 'h': |
| 236 | my_usage(); | 239 | my_usage(); |
| 237 | return(0); | 240 | return(0); |
| @@ -414,6 +417,7 @@ void my_usage(void) | |||
| 414 | // line. The two strings referenced are: PROGRAM_NAME, and | 417 | // line. The two strings referenced are: PROGRAM_NAME, and |
| 415 | // PACKAGE_BUGREPORT | 418 | // PACKAGE_BUGREPORT |
| 416 | printf(_("Usage: %s [OPTIONS] string1 string2 ... stringN\n" | 419 | printf(_("Usage: %s [OPTIONS] string1 string2 ... stringN\n" |
| 420 | " -b use obsolete ``basic'' REs\n" | ||
| 417 | " -h, --help print this help and exit\n" | 421 | " -h, --help print this help and exit\n" |
| 418 | " -i ignore upper/lower case distinctions.\n" | 422 | " -i ignore upper/lower case distinctions.\n" |
| 419 | " -p, --posixregex print regular expression patterns\n" | 423 | " -p, --posixregex print regular expression patterns\n" |
