aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/one-true-awk/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/one-true-awk/main.c')
-rw-r--r--contrib/one-true-awk/main.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/contrib/one-true-awk/main.c b/contrib/one-true-awk/main.c
index 5b0421850787..e1ed1773e09b 100644
--- a/contrib/one-true-awk/main.c
+++ b/contrib/one-true-awk/main.c
@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20050424";
+const char *version = "version 20070501";
#define DEBUG
#include <stdio.h>
@@ -61,14 +61,21 @@ int main(int argc, char *argv[])
setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */
cmdname = argv[0];
if (argc == 1) {
- fprintf(stderr, "Usage: %s [-f programfile | 'program'] [-Ffieldsep] [-v var=value] [files]\n", cmdname);
+ fprintf(stderr,
+ "usage: %s [-F fs] [-v var=value] [-f progfile | 'prog'] [file ...]\n",
+ cmdname);
exit(1);
}
signal(SIGFPE, fpecatch);
yyin = NULL;
- symtab = makesymtab(NSYMTAB);
+ symtab = makesymtab(NSYMTAB/NSYMTAB);
while (argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') {
- if (strcmp(argv[1], "--") == 0) { /* explicit end of args */
+ if (strcmp(argv[1],"-version") == 0 || strcmp(argv[1],"--version") == 0) {
+ printf("awk %s\n", version);
+ exit(0);
+ break;
+ }
+ if (strncmp(argv[1], "--", 2) == 0) { /* explicit end of args */
argc--;
argv++;
break;
@@ -107,20 +114,12 @@ int main(int argc, char *argv[])
if (argv[1][2] == '\0' && --argc > 1 && isclvar((++argv)[1]))
setclvar(argv[1]);
break;
- case 'm': /* more memory: -mr=record, -mf=fields */
- /* no longer supported */
- WARNING("obsolete option %s ignored", argv[1]);
- break;
case 'd':
dbg = atoi(&argv[1][2]);
if (dbg == 0)
dbg = 1;
printf("awk %s\n", version);
break;
- case 'V': /* added for exptools "standard" */
- printf("awk %s\n", version);
- exit(0);
- break;
default:
WARNING("unknown option %s ignored", argv[1]);
break;