aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/one-true-awk/main.c
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2007-06-05 15:33:51 +0000
committerRong-En Fan <rafan@FreeBSD.org>2007-06-05 15:33:51 +0000
commitaddad6af5ae5c3a2397dafe2f2c82f556ec25258 (patch)
tree7bb9ff82caf83e12ec1ddc1afdc1af4854a723b6 /contrib/one-true-awk/main.c
parentc263f9bff0718f9ee4e421e7c3354b1984f28870 (diff)
downloadsrc-addad6af5ae5c3a2397dafe2f2c82f556ec25258.tar.gz
src-addad6af5ae5c3a2397dafe2f2c82f556ec25258.zip
Vendor import of bwk's 01-May-2007 release.
Approved by: delphij (mentor) Nodded by: ru Tested by: make universe
Notes
Notes: svn path=/vendor/one-true-awk/dist/; revision=170331
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;