let guess_major_version tool_file_loc =
let loc = extract_location tool_file_loc in
try
let basename = Filename.basename loc in
let dash_idx = String.find basename ~f:(fun c -> c ='-') in
match dash_idx with
| Some i -> String.get basename (i + 1)
| None -> None
with _ ->
ksprintf
failwith
"Error while guessing NetMHC major version from %s"
loc