html2broadcast.ml 789 B

123456789101112131415161718192021222324
  1. let () =
  2. let print_help oc =
  3. let msg =
  4. "T.b.d.\n\n\
  5. SYNOPSIS\n\n\
  6. \ $ ./html2broadcast -h # get this help\n\
  7. \ $ ./html2broadcast -V # version\n\n\
  8. EXAMPLE\n\n\
  9. \ $ ./html2broadcast < ausstrahlung-9284673.html\n"
  10. in
  11. Printf.fprintf oc "%s\n" msg;
  12. 0
  13. and print_version oc =
  14. let exe = Sys.executable_name |> Filename.basename in
  15. Printf.fprintf oc "%s: https://mro.name/%s/v%s, built: %s\n" exe
  16. "broadcast-scrape-br" Version.git_sha Version.date;
  17. 0
  18. in
  19. (match Sys.argv |> Array.to_list |> List.tl with
  20. | [] -> Lib.Br.scrape stdin |> Lib.Broadcast.to_xml stdout
  21. | [ "-V" ] | [ "--version" ] -> print_version stdout
  22. | [ "-h" ] | [ "--help" ] | _ -> print_help stdout)
  23. |> exit