Changeset 17 in code
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/dune
r9 r17 2 2 (name txt) 3 3 (public_name txt) 4 (modules txt authors convert conversion file index last listing new topics html atom gemini publish pull read )4 (modules txt authors convert conversion file index last listing new topics html atom gemini publish pull read recent) 5 5 (libraries text_parse.converter text_parse.parsers logarion msgpck curl str cmdliner)) -
trunk/cli/last.ml
r3 r17 1 1 open Logarion 2 3 let last a ((t,_) as pair) = match a with 4 | None -> Some pair 5 | Some (t', _) as pair' -> 6 if Text.newest t t' > 0 then Some pair else pair' 7 8 let last_mine a ((t, _) as pair) = 9 let name = Person.Set.of_string (Sys.getenv "USER") in 10 let open Text in 11 match a with 12 | None -> if Person.Set.subset name t.authors then Some pair else None 13 | Some (t', _) as pair' -> 14 if Text.newest t t' > 0 && Person.Set.subset name t'.authors 15 then Some pair else pair' 16 2 17 let last search_mine = 3 let last a ((t,_) as pair) = match a with None -> Some pair 4 | Some (t', _) as pair' -> if Text.newest t t' > 0 5 then Some pair else pair' in 6 let last_mine a ((t,_) as pair) = 7 let name = Person.Set.of_string (Sys.getenv "USER") in 8 let open Text in 9 match a with 10 | None -> if Person.Set.subset name t.authors then Some pair else None 11 | Some (t', _) as pair' -> 12 if Text.newest t t' > 0 && Person.Set.subset name t'.authors 13 then Some pair else pair' 14 in 15 match File_store.fold (if search_mine then last_mine else last) None with 16 | Some (_,f) -> List.iter print_endline f | None -> () 18 let filter = if search_mine then last_mine else last in 19 match File_store.fold filter None with 20 | None -> () 21 | Some (_, f) -> List.iter print_endline f 17 22 18 23 open Cmdliner 19 24 let term = 20 let mine = Arg.(value & flag & info ["mine"] 21 ~doc:"last text authored by me") in 25 let mine = Arg.(value & flag & info ["mine"] ~doc:"last text authored by me") in 22 26 Term.(const last $ mine), 23 27 Term.info "last" ~doc:"most recent text" -
trunk/cli/txt.ml
r9 r17 18 18 Pull.term; 19 19 Read.term; 20 Recent.term; 20 21 Topics.term; 21 22 ] with `Error _ -> exit 1 | _ -> exit 0
Note:
See TracChangeset
for help on using the changeset viewer.