aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Jacques-Pascal Deplaix <jp.deplaix@gmail.com>2018-01-15 15:55:18 +0000
committerGravatar Jacques-Pascal Deplaix <jp.deplaix@gmail.com>2018-01-15 16:22:19 +0000
commit6215d67fd1f94ccd25bb0059e7441ec529fc9ad8 (patch)
tree67b61720949b49dd9c0063821dc22b5f5fe7be3b /tools
parent47ceedd5a6f726a58ee7b57c4d80ffd2e80549de (diff)
Avoid shell backticks and improve md5sum.ml error messages
Diffstat (limited to 'tools')
-rw-r--r--tools/md5sum.ml7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/md5sum.ml b/tools/md5sum.ml
index 16bbdb579..2fdcacc83 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 <FILE>";
+ prerr_endline "Print MD5 (128-bit) checksum of the file content modulo \\r.";
exit 1