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

Last change on this file since 67 was 66, checked in by Izuru Yakumo, 8 months ago

Migrate the codebase to the latest revision of Cmdliner

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

File size: 1.1 KB
Line 
1open Cmdliner
2let id = Arg.(value & pos 0 string "" & info [] ~docv: "text ID")
3let recurse = Arg.(value & flag & info ["R"] ~doc: "Recurse into subdirectories")
4let reverse = Arg.(value & flag & info ["r"] ~doc: "Reverse order")
5let time = Arg.(value & flag & info ["t"] ~doc: "Sort by time, newest first")
6let number = Arg.(value & opt (some int) None & info ["n"] ~docv: "number" ~doc: "Number of entries to list")
7let authed = Arg.(value & opt (some string) None & info ["authored"] ~docv: "Comma-separated names" ~doc: "Texts by authors")
8let topics = Arg.(value & opt (some string) None & info ["topics"] ~docv: "Comma-separated topics" ~doc: "Texts by topics")
9
10let edit_t = Term.(const (Logarion.Archive.apply_sys_util "EDITOR" "nano") $ recurse $ time $ reverse $ number $ authed $ topics $ id)
11
12let cmd =
13 let doc = "Edit a text" in
14 let man = [
15 `S Manpage.s_description;
16 `P "Launches EDITOR (nano if environment variable is unset) with text path as parameter.";
17 `P "If -R is used, the ID search space includes texts found in subdirectories, too." ]
18 in
19 let info = Cmd.info "edit" ~version:"%%VERSION%%" ~doc ~man in
20 Cmd.v info edit_t
Note: See TracBrowser for help on using the repository browser.