From 6215d67fd1f94ccd25bb0059e7441ec529fc9ad8 Mon Sep 17 00:00:00 2001 From: Jacques-Pascal Deplaix Date: Mon, 15 Jan 2018 15:55:18 +0000 Subject: Avoid shell backticks and improve md5sum.ml error messages --- tools/md5sum.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/md5sum.ml b/tools/md5sum.ml index 16bbdb5794..2fdcacc839 100644 --- a/tools/md5sum.ml +++ b/tools/md5sum.ml @@ -7,8 +7,9 @@ let get_content file = git checkout has included return characters. See: https://github.com/coq/coq/pull/6305 *) | c -> Buffer.add_char buf c; fill () + | exception End_of_file -> close_in ic; Buffer.contents buf in - try fill () with End_of_file -> Buffer.contents buf + fill () let () = match Sys.argv with @@ -18,6 +19,6 @@ let () = print_string (md5 ^ " " ^ file) | _ -> prerr_endline "Error: This program needs exactly one parameter."; - prerr_endline "Usage: ocaml md5sum.ml [FILE]"; - prerr_endline "Print MD5 (128-bit) checksum."; + prerr_endline "Usage: ocaml md5sum.ml "; + prerr_endline "Print MD5 (128-bit) checksum of the file content modulo \\r."; exit 1 -- cgit v1.2.3