[BACK]Return to ex.awk CVS log [TXT][DIR] Up to [local] / src / usr.bin / vi / ex

File: [local] / src / usr.bin / vi / ex / ex.awk (download)

Revision 1.3, Thu Dec 14 10:02:53 2017 UTC (6 years, 5 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, HEAD
Changes since 1.2: +11 -3 lines

Enable the awk scripts to generate ex_def.h and options_def.h.
These scripts generate the enums required for the ex commands and vi
options.
Before these lists had to be maintained either by hand or someone had to
stumble upon these scripts and figure out how to use them. By enabling them
these headers are now always in sync based on the comments in the
corresponding source files, which are a lot harder to miss during an
update than an extra file.

Update the awk scripts to the new enum style introduced by bentley@ with
his update on options_def.h r1.7

Feedback Makefile semantics by espie@
Original diff and OK tb@
OK millert@

#	$OpenBSD: ex.awk,v 1.3 2017/12/14 10:02:53 martijn Exp $

#	@(#)ex.awk	10.1 (Berkeley) 6/8/95

BEGIN {
	printf("enum {");
	first = 1;
}
/^\/\* C_[0-9A-Z_]* \*\/$/ {
	printf("%s\n\t%s%s", first ? "" : ",", $2, first ? " = 0" : "");
	first = 0;
	next;
}
END {
	printf("\n};\n");
}