-
Notifications
You must be signed in to change notification settings - Fork 0
/
dolblens.ml
37 lines (30 loc) · 1023 Bytes
/
dolblens.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
open Common
open Getopt
let mark' = ref ""
let prefix' = ref "le"
let outdir' = ref (Some "lblens")
let specs =
[
(noshort,"prefix",None,Some (fun x -> prefix' := x));
(noshort,"outdir",None,Some (fun x -> outdir' := Some x));
(noshort,"nodir", (set outdir' None), None);
('k',"mark",None,Some (fun x -> mark' := x))
]
let () =
let args = getOptArgs specs in
let prefix, outdir, mark =
!prefix', !outdir', !mark' in
let bucksName,outdir =
match args with
| bucksName::outdir::restArgs -> bucksName,Some outdir
| bucksName::restArgs -> bucksName,outdir
| _ -> failwith "usage: dolblens bucksName [outdir]"
in
let baseName = cutPathZ bucksName in
let lensName = sprintf "%s%s%s" prefix mark baseName |> mayPrependDir outdir in
leprintfln "reading buckets from %s, saving lengths in %s"
bucksName lensName;
let bucks: day_log_buckets = loadData bucksName in
let lens = Dcaps.bucket_lens bucks in
mayMkDir outdir;
saveData lens lensName