Changeset 66 in code for trunk/cli/new.ml
- Timestamp:
- Aug 21, 2024, 1:37:05 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/new.ml
r65 r66 1 1 open Logarion 2 open Ocmd2 open Cmdliner 3 3 4 4 let new_txt title topics_opt interactive = … … 14 14 print_endline filepath 15 15 16 let term = 17 let title = Arg.(value & pos 0 string "" & info [] 18 ~docv:"title" ~doc:"Title for new article") in 19 let topics= Arg.(value & opt (some string) None & info ["t"; "topics"] 20 ~docv:"comma-separated topics" ~doc:"Topics for new article") in 21 let inter = Arg.(value & flag & info ["i"; "interactive"] 22 ~doc:"Prompts through the steps of creation") in 23 Term.(const new_txt $ title $ topics $ inter), Term.info "new" 24 ~doc:"create a new article" ~man:[ `S "DESCRIPTION"; 25 `P "Create a new article, with title 'Draft' when none provided"] 16 let title = Arg.(value & pos 0 string "" & info [] ~docv: "title" ~doc: "Title for new article") 17 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 20 let new_t = Term.(const new_txt $ title $ topics $ inter) 21 22 let cmd = 23 let doc = "Create a new article" in 24 let man = [ 25 `S Manpage.s_description; 26 `P "Create a new article, with title 'Draft' when none provided" ] 27 in 28 let info = Cmd.info "new" ~version:"%%VERSION%%" ~doc ~man in 29 Cmd.v info new_t
Note:
See TracChangeset
for help on using the changeset viewer.