New edit <ID> command and updated readme
git-svn-id: file:///srv/svn/repo/kosuzu/trunk@25 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
16
cli/edit.ml
Normal file
16
cli/edit.ml
Normal file
@@ -0,0 +1,16 @@
|
||||
open Cmdliner
|
||||
let term =
|
||||
let id = Arg.(value & pos 0 string "" & info [] ~docv:"text ID") in
|
||||
let recurse = Arg.(value & flag & info ["R"] ~doc:"recurse, include subdirs") in
|
||||
let reverse = Arg.(value & flag & info ["r"] ~doc:"reverse order") in
|
||||
let time = Arg.(value & flag & info ["t"] ~doc:"sort by time, newest first") in
|
||||
let number = Arg.(value & opt (some int) None & info ["n"]
|
||||
~docv:"number" ~doc:"number of entries to list") in
|
||||
let authed = Arg.(value & opt (some string) None & info ["authored"]
|
||||
~docv:"comma-separated names" ~doc:"texts by authors") in
|
||||
let topics = Arg.(value & opt (some string) None & info ["topics"]
|
||||
~docv:"comma-separated topics" ~doc:"texts with topics") in
|
||||
Term.(const (Logarion.Archive.apply_sys_util "EDITOR" "nano") $ recurse $ time $ reverse $ number $ authed $ topics $ id),
|
||||
Term.info "edit" ~doc: "edit a text" ~man:[ `S "DESCRIPTION";
|
||||
`P "Launches $EDITOR with text path as parameter. If -R is used, the ID search space
|
||||
includes texts found in subdirectories too" ]
|
||||
Reference in New Issue
Block a user