From d452f359566ec6593aad564acb281f5a49dd931a Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Wed, 8 May 2019 21:12:09 +0200 Subject: Option -check-vio-tasks: fail gracefully when not finding expected integers. --- toplevel/coqcargs.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/toplevel/coqcargs.ml b/toplevel/coqcargs.ml index 7445619d26..c3f099869c 100644 --- a/toplevel/coqcargs.ml +++ b/toplevel/coqcargs.ml @@ -82,7 +82,14 @@ let set_vio_checking_j opts opt j = prerr_endline "setting the J variable like in 'make vio2vo J=3'"; exit 1 -let get_task_list s = List.map int_of_string (Str.split (Str.regexp ",") s) +let get_task_list s = + List.map (fun s -> + try int_of_string s + with Failure _ -> + prerr_endline "Option -check-vio-tasks expects a comma-separated list"; + prerr_endline "of integers followed by a list of files"; + exit 1) + (Str.split (Str.regexp ",") s) let is_not_dash_option = function | Some f when String.length f > 0 && f.[0] <> '-' -> true -- cgit v1.2.3