source: code/trunk/cli/last.ml@ 11

Last change on this file since 11 was 3, checked in by fox, 3 years ago
  • Removed 'txt init'

Format

  • New B32 ID

Index

  • New option: txt index --print
  • Move scheme to peers
  • Replace peer.*.conf files with index packed locations Instead of adding a URL to peers.*.conf, run txt pull <url>

Conversion

  • Rewritten converters
  • txt-convert looks for a .convert.conf containing key: value lines.
  • Specifiable topic-roots from .convert.conf.
  • Added Topics: key, with comma seperated topics.

If set only those topics will appear in the main index and used as topic roots.
Other topics will have sub-indices generated, but won't be listed in the main index.

  • HTML converter header & footer options
  • HTML-index renamed to HTM-index

Internal

  • Change types: uuid:Uuid -> id:string
  • File_store merges identical texts
  • Use peer ID for store path, store peers' texts in .local/share/texts
  • Simple URN resolution for converter

Continue to next feed if parsing one fails

  • Phasing-out Archive, replaced by improved packs
  • Eliminate Bos, Cohttp, lwt, uri, tls, Re, Ptime, dependencies
  • Lock version for Cmdliner, fix dune-project
  • Optional resursive store
  • Improve header_pack
  • Fix recursive mkdir
File size: 891 bytes
Line 
1open Logarion
2let 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 -> ()
17
18open Cmdliner
19let term =
20 let mine = Arg.(value & flag & info ["mine"]
21 ~doc:"last text authored by me") in
22 Term.(const last $ mine),
23 Term.info "last" ~doc:"most recent text"
24 ~man:[ `S "DESCRIPTION"; `P "Print the filename of most recent text" ]
Note: See TracBrowser for help on using the repository browser.