let cin =
let ofile = ref None in
let set_file s =
if Filename.check_suffix s ".cub" then ofile := Some s
else raise (Arg.Bad "no .cub extension");
in
Arg.parse alspecs set_file usage;
match !ofile with
| Some f -> file := f ; open_in f
| None -> stdin