summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/groff/grog/grog.sh
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2011-03-12 19:04:03 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2011-03-12 19:04:03 +0000
commit872b6ee7400edb775c362a39717e7942528eb707 (patch)
tree99903d255fb5924b4d19de8861964f4a93f6afc0 /gnu/usr.bin/groff/grog/grog.sh
parent30c1ecbeb90c0d739a2f8dd74d15e05b79aba36e (diff)
Replaced by mandoc(1) for base and xenocara purposes,
and comes with 4.9 ports. ok deraadt@
Diffstat (limited to 'gnu/usr.bin/groff/grog/grog.sh')
-rw-r--r--gnu/usr.bin/groff/grog/grog.sh78
1 files changed, 0 insertions, 78 deletions
diff --git a/gnu/usr.bin/groff/grog/grog.sh b/gnu/usr.bin/groff/grog/grog.sh
deleted file mode 100644
index 631b356aa93..00000000000
--- a/gnu/usr.bin/groff/grog/grog.sh
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/sh
-# grog -- guess options for groff command
-# Like doctype in Kernighan & Pike, Unix Programming Environment, pp 306-8.
-
-soelim=gsoelim
-
-opts=
-
-for arg
-do
- case "$arg" in
- --)
- shift; break;;
- -)
- break;;
- -*)
- opts="$opts $arg"; shift;;
- *)
- break;;
- esac
-done
-
-egrep -h '^\.(P|[LI]P|[pnil]p|sh|Dd|Tp|Dp|De|Cx|Cl|Oo|Oc|TS|EQ|TH|SH|so|\[|R1|PH|SA)' $* \
-| sed -e '/^\.so/s/^.*$/.SO_START\
-&\
-.SO_END/' \
-| $soelim \
-| egrep '^\.(P|[LI]P|[pnil]p|sh|Dd|Tp|Dp|De|Cx|Cl|Oo|Oc|TS|EQ|TH|SH|\[|R1|PH|SA|SO_START|SO_END)' \
-| awk '
-/^\.SO_START$/ { so = 1 }
-/^\.SO_END$/ { so = 0 }
-/^\.TS/ { tbl++; if (so > 0) soelim++ }
-/^\.PS([ 0-9.<].*)?$/ { pic++; if (so > 0) soelim++ }
-/^\.EQ/ { eqn++; if (so > 0) soelim++ }
-/^\.(R1|\[)/ { refer++; if (so > 0) soelim++ }
-/^\.TH/ { TH++ }
-/^\.[PLI]P/ { PP++ }
-/^\.P$/ { P++ }
-/^\.SH/ { SH++ }
-/^\.(PH|SA)/ { mm++ }
-/^\.([pnil]p|sh)/ { me++ }
-/^\.Dd/ { mdoc++ }
-/^\.(Tp|Dp|De|Cx|Cl)/ { mdoc_old++ }
-/^\.Oo/ { Oo++ }
-/^\.Oc/ { Oo-- }
-
-END {
- if (files ~ /^-/)
- files = "-- " files
- printf "groff"
- if (pic > 0 || tbl > 0 || eqn > 0 || refer > 0) {
- printf " -"
- if (soelim > 0) printf "s"
- if (refer > 0) printf "R"
- if (pic > 0) printf "p"
- if (tbl > 0) printf "t"
- if (eqn > 0) printf "e"
- }
- if (me > 0)
- printf " -me"
- else if (SH > 0 && TH > 0)
- printf " -man"
- else if (PP > 0)
- printf " -ms"
- else if (P > 0 || mm > 0)
- printf " -mm"
- else if (mdoc > 0) {
- if (mdoc_old > 0 || Oo > 0)
- printf " -mdoc.old"
- else
- printf " -mdoc"
- }
- if (opts != "")
- printf "%s", opts
- if (files != "")
- printf " %s", files
- print ""
-}' "opts=$opts" "files=$*" -