feat: support multiple input files
- 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
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
open Cmdliner
|
||||
open Cmdliner.Term.Syntax
|
||||
|
||||
let ical_file =
|
||||
let doc = "TODO" in
|
||||
let docv = "ICAL" in
|
||||
Arg.(required & pos ~rev:true 0 (some string) None & info [] ~docv ~doc)
|
||||
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+ ical_file = ical_file in
|
||||
f ical_file
|
||||
let+ files = files in
|
||||
f files
|
||||
|
||||
let main f = Cmd.eval @@ main_command f
|
||||
|
||||
Reference in New Issue
Block a user