source: code/trunk/cmd/txt/edit.ml

Last change on this file was 73, checked in by Izuru Yakumo, 8 months ago

Because sweet girls are the best, officially rebranding Logarion to Kosuzu

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

File size: 1.2 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 (Kosuzu.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 `S Manpage.s_environment;
19 `P "EDITOR - Default editor name" ]
20 in
21 let info = Cmd.info "edit" ~doc ~man in
22 Cmd.v info edit_t
Note: See TracBrowser for help on using the repository browser.