Changeset 70 in code for trunk/cli/new.ml
- Timestamp:
- Aug 21, 2024, 1:31:58 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/new.ml
r69 r70 2 2 open Cmdliner 3 3 4 let new_txt title topics_opt interactive=4 let new_txt title topics_opt = 5 5 let kv = Logarion.File_store.of_kv_file () in 6 6 let authors = Person.Set.of_string (try Logarion.Store.KV.find "Authors" kv … … 11 11 | Error s -> prerr_endline s 12 12 | Ok (filepath, _note) -> 13 if interactive then (Sys.command ("$EDITOR " ^ filepath) |> ignore);14 13 print_endline filepath 15 14 16 15 let title = Arg.(value & pos 0 string "" & info [] ~docv: "title" ~doc: "Title for new article") 17 16 let topics = Arg.(value & opt (some string) None & info ["t"; "topics"] ~docv: "Comma-separated topics" ~doc: "Topics for new article") 18 let inter = Arg.(value & flag & info ["i"; "interactive"] ~doc: "Prompt through the steps of creation")19 17 20 let new_t = Term.(const new_txt $ title $ topics $ inter)18 let new_t = Term.(const new_txt $ title $ topics) 21 19 22 20 let cmd = … … 26 24 `P "Create a new article"; 27 25 `S Manpage.s_environment; 28 `P "USER - The login name of the user, used if the Authors field is blank"; 29 `P "EDITOR - Default editor name" ] 26 `P "USER - The login name of the user, used if the Authors field is blank" ] 30 27 in 31 28 let info = Cmd.info "new" ~doc ~man in
Note:
See TracChangeset
for help on using the changeset viewer.