Changeset 70 in code for trunk/cli/new.ml


Ignore:
Timestamp:
Aug 21, 2024, 1:31:58 PM (8 months ago)
Author:
yakumo.izuru
Message:

What is the point of --interactive if it throws you into a text editor, anyway?

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/new.ml

    r69 r70  
    22open Cmdliner
    33
    4 let new_txt title topics_opt interactive =
     4let new_txt title topics_opt =
    55        let kv = Logarion.File_store.of_kv_file () in
    66        let authors = Person.Set.of_string (try Logarion.Store.KV.find "Authors" kv
     
    1111        | Error s -> prerr_endline s
    1212        | Ok (filepath, _note) ->
    13                 if interactive then (Sys.command ("$EDITOR " ^ filepath) |> ignore);
    1413                print_endline filepath
    1514
    1615let title = Arg.(value & pos 0 string "" & info [] ~docv: "title" ~doc: "Title for new article")
    1716let 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")
    1917
    20 let new_t = Term.(const new_txt $ title $ topics $ inter)
     18let new_t = Term.(const new_txt $ title $ topics)
    2119
    2220let cmd =
     
    2624      `P "Create a new article";
    2725      `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" ]
    3027  in
    3128  let info = Cmd.info "new" ~doc ~man in
Note: See TracChangeset for help on using the changeset viewer.