projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
document distributed with 4.1BSD
[unix-history]
/
usr
/
src
/
usr.bin
/
ex
/
makeoptions
diff --git
a/usr/src/usr.bin/ex/makeoptions
b/usr/src/usr.bin/ex/makeoptions
index
46238ce
..
51d5548
100644
(file)
--- a/
usr/src/usr.bin/ex/makeoptions
+++ b/
usr/src/usr.bin/ex/makeoptions
@@
-1,8
+1,16
@@
+#
+# Copyright (c) 1980 Regents of the University of California.
+# All rights reserved. The Berkeley software License Agreement
+# specifies the terms and conditions for redistribution.
+#
+# @(#)makeoptions 6.4 (Berkeley) %G%
+#
+
#
# remake options -- this isn't necessary unless you add/delete options
#
onintr ifintr
#
# remake options -- this isn't necessary unless you add/delete options
#
onintr ifintr
-c
p ex_data.c
/tmp/$$.c
+c
at < ex_data.c >
/tmp/$$.c
ex - /tmp/$$.c <<'%'
g/^#include/d
w
ex - /tmp/$$.c <<'%'
g/^#include/d
w
@@
-18,17
+26,17
@@
ex - /tmp/foo.c <<'X'
1,/option options/d
/}/-1,$d
" get rid of all of line but option name
1,/option options/d
/}/-1,$d
" get rid of all of line but option name
- 1,$s/
"//
+ 1,$s/
[ ]*
"//
1,$s/".*//
1,$s/".*//
- 1m$ " kludge since options start at 0 but num at 1
- %!num
- $t0 " unkludge
- 1s/......../ 0 / " unkludge
+ " begin kludge since options start at 0 but cat -n starts at 1
+ " move first to end and later move it back and renumber
+ 1m$
+ %!cat -n
+ $t0
+ 1s/[0-9][0-9]*/0/
+ " end kludge
" make #define lines
" make #define lines
- 1,$s/\(......\)\(.*\)/#define \U\2\L \1/
- " get rid of extra blanks, turning into (single) tabs.
- 1,$s/ */ /g
- g/ */s// /g
+ 1,$s/[ ]*\([0-9][0-9]*\)[ ]*\(.*\)/#define \U\2\L \1/
" filter through expand to make it line up nice
%!expand -8\,24
" blank line and number of options.
" filter through expand to make it line up nice
%!expand -8\,24
" blank line and number of options.
@@
-37,7
+45,7
@@
ex - /tmp/foo.c <<'X'
.
$s/e[ ].*[ ]/e NOPTS /
0a
.
$s/e[ ].*[ ]/e NOPTS /
0a
- /* sccs id @(#) ex_vars.h @(#)makeoptions 6.
1
%G% */
+ /* sccs id @(#) ex_vars.h @(#)makeoptions 6.
4
%G% */
.
w! ex_vars.h
q
.
w! ex_vars.h
q