From d135d7e859acef96549301862f9b098e0c76cacf Mon Sep 17 00:00:00 2001 From: malc Date: Wed, 26 Aug 2015 09:02:52 +0300 Subject: [PATCH] Back to ocaml To be safe sed script has to do everything String.escaped does (and this version only does quote escaping), so back to ocaml. --- mkhelp.sh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) rewrite mkhelp.sh (61%) diff --git a/mkhelp.sh b/mkhelp.sh dissimilarity index 61% index 630f289..441c982 100644 --- a/mkhelp.sh +++ b/mkhelp.sh @@ -1,12 +1,16 @@ -#!/bin/sh -set -e -v=$(cd $(dirname $0) && git describe --tags --dirty 2>/dev/null || echo unknown) -sed "$1" -f - </dev/null || echo unknown) +ocaml str.cma -stdin "$1" "$v" < global_replace dash "\\\\1\\t\\\\2" s |> + global_replace head "\\xc2\\xb7\\\\1";; +let rec iter ic = match input_line ic with +| s -> Printf.printf "%S;\\n" @@ fixup s; iter ic +| exception End_of_file -> ();; +Printf.printf "let keys = [\\n"; +iter @@ open_in Sys.argv.(1);; +Printf.printf "];;\\nlet version = %S;;\\n" Sys.argv.(2);; +EOF -- 2.11.4.GIT