Change create subcommand to new

This commit is contained in:
orbifx 2021-06-07 20:50:42 +01:00
parent 114bfafdce
commit 279402457a

View File

@ -71,11 +71,11 @@ let init _force = File_store.init ()
let init_term =
let force = Arg.(value & flag & info ["f"; "force"] ~doc:"Initialise even if directory is not empty") in
let doc = "initialise a logarion repository in present directory" in
let man = [ `S "DESCRIPTION"; `P "Create a repository in current directory" ] in
let doc = "initialise a text repository in present directory" in
let man = [ `S "DESCRIPTION"; `P "Start an archive in current directory" ] in
Term.(const init $ force), Term.info "init" ~doc ~man
let create_term =
let new_term =
let f title topics_opt interactive =
match A.of_path "." with
| Error m -> prerr_endline m
@ -98,14 +98,14 @@ let create_term =
let topics= Arg.(value & opt (some string) None & info ["t"; "topics"] ~docv:"TOPICS" ~doc:"Topics for new article") in
let inter = Arg.(value & flag & info ["i"; "interactive"] ~doc:"Prompts through the steps of creation and publication") in
let man = [ `S "DESCRIPTION"; `P "Create a new article, with title 'Draft' when none provided"] in
Term.(const f $ title $ topics $ inter), Term.info "create" ~doc:"create a new article" ~man
Term.(const f $ title $ topics $ inter), Term.info "new" ~doc:"create a new article" ~man
let default_cmd =
let doc = "text archival & publishing" in
let man = [ `S "BUGS"; `P "Submit bugs <mailto:logarion@lists.orbitalfox.eu?subject=[Issue] summary-here>" ] in
Term.(ret (const (`Help (`Pager, None)))), Term.info "logarion" ~version ~doc ~man
let cmds = [ init_term; create_term; file_term; unfile_term; list_term; Convert.term ]
let cmds = [ init_term; new_term; file_term; unfile_term; list_term; Convert.term ]
let () =
Random.self_init();