source: code/trunk/cli/edit.ml@ 34

Last change on this file since 34 was 25, checked in by fox, 2 years ago

New edit <ID> command and updated readme

File size: 1.0 KB
Line 
1open Cmdliner
2let term =
3 let id = Arg.(value & pos 0 string "" & info [] ~docv:"text ID") in
4 let recurse = Arg.(value & flag & info ["R"] ~doc:"recurse, include subdirs") in
5 let reverse = Arg.(value & flag & info ["r"] ~doc:"reverse order") in
6 let time = Arg.(value & flag & info ["t"] ~doc:"sort by time, newest first") in
7 let number = Arg.(value & opt (some int) None & info ["n"]
8 ~docv:"number" ~doc:"number of entries to list") in
9 let authed = Arg.(value & opt (some string) None & info ["authored"]
10 ~docv:"comma-separated names" ~doc:"texts by authors") in
11 let topics = Arg.(value & opt (some string) None & info ["topics"]
12 ~docv:"comma-separated topics" ~doc:"texts with topics") in
13 Term.(const (Logarion.Archive.apply_sys_util "EDITOR" "nano") $ recurse $ time $ reverse $ number $ authed $ topics $ id),
14 Term.info "edit" ~doc: "edit a text" ~man:[ `S "DESCRIPTION";
15 `P "Launches $EDITOR with text path as parameter. If -R is used, the ID search space
16 includes texts found in subdirectories too" ]
Note: See TracBrowser for help on using the repository browser.