Last change
on this file since 75 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 | |
---|
1 | open Cmdliner
|
---|
2 | let id = Arg.(value & pos 0 string "" & info [] ~docv: "text ID")
|
---|
3 | let recurse = Arg.(value & flag & info ["R"] ~doc: "Recurse into subdirectories")
|
---|
4 | let reverse = Arg.(value & flag & info ["r"] ~doc: "Reverse order")
|
---|
5 | let time = Arg.(value & flag & info ["t"] ~doc: "Sort by time, newest first")
|
---|
6 | let number = Arg.(value & opt (some int) None & info ["n"] ~docv: "number" ~doc: "Number of entries to list")
|
---|
7 | let authed = Arg.(value & opt (some string) None & info ["authored"] ~docv: "Comma-separated names" ~doc: "Texts by authors")
|
---|
8 | let topics = Arg.(value & opt (some string) None & info ["topics"] ~docv: "Comma-separated topics" ~doc: "Texts by topics")
|
---|
9 |
|
---|
10 | let edit_t = Term.(const (Kosuzu.Archive.apply_sys_util "EDITOR" "nano") $ recurse $ time $ reverse $ number $ authed $ topics $ id)
|
---|
11 |
|
---|
12 | let 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.