- Accept multiple positional arguments instead of a single required file - Extract `read_file` helper to separate file reading from parsing - Collect all valid reminders across files before printing - Handle per-file errors gracefully without aborting the whole run
17 lines
397 B
OCaml
17 lines
397 B
OCaml
open Cmdliner
|
|
open Cmdliner.Term.Syntax
|
|
|
|
let files =
|
|
let doc = "Files to process" in
|
|
Arg.(non_empty & pos_all string [] & info [] ~docv:"FILE" ~doc)
|
|
|
|
let main_command f =
|
|
let doc = "Convert iCalendar files to remind format" in
|
|
let man = [] in
|
|
Cmd.make (Cmd.info "ical2rem" ~version:"%%VERSION%%" ~doc ~man)
|
|
@@
|
|
let+ files = files in
|
|
f files
|
|
|
|
let main f = Cmd.eval @@ main_command f
|