···9898 See {!Store.thumbnail_path} for details. *)
9999val thumbnail_path : t -> Contact.t -> Eio.Fs.dir_ty Eio.Path.t option
100100101101+(** [png_thumbnail_path t contact] returns the path to the PNG version of a contact's thumbnail.
102102+ See {!Store.png_thumbnail_path} for details. *)
103103+val png_thumbnail_path : t -> Contact.t -> Eio.Fs.dir_ty Eio.Path.t option
104104+101105(** [find_by_name t name] searches for contacts by name.
102106 See {!Store.find_by_name} for details. *)
103107val find_by_name : t -> string -> Contact.t
+14
sortal/lib/core/sortal_cmd.ml
···4242 0
4343 | None -> Logs.err (fun m -> m "Contact not found: %s" handle); 1
44444545+let thumbnail_cmd handle xdg =
4646+ let store = Sortal_store.create_from_xdg xdg in
4747+ match Sortal_store.lookup store handle with
4848+ | None -> Logs.err (fun m -> m "Contact not found: %s" handle); 1
4949+ | Some c ->
5050+ match Sortal_store.thumbnail_path store c with
5151+ | Some path ->
5252+ Printf.printf "%s\n" (Eio.Path.native_exn path);
5353+ 0
5454+ | None ->
5555+ Logs.err (fun m -> m "No thumbnail for contact: %s" handle);
5656+ 1
5757+4558let search_cmd query xdg =
4659 let store = Sortal_store.create_from_xdg xdg in
4760 match Sortal_store.search_all store query with
···314327(* Command info and args *)
315328let list_info = Cmd.info "list" ~doc:"List all contacts"
316329let show_info = Cmd.info "show" ~doc:"Show detailed information about a contact"
330330+let thumbnail_info = Cmd.info "thumbnail" ~doc:"Print the thumbnail file path for a contact"
317331let search_info = Cmd.info "search" ~doc:"Search contacts by name"
318332let stats_info = Cmd.info "stats" ~doc:"Show statistics about the contact database"
319333let sync_info = Cmd.info "sync" ~doc:"Synchronize and normalize contact data"
+11
sortal/lib/core/sortal_cmd.mli
···2323 @param handle The contact handle to display *)
2424val show_cmd : string -> (Xdge.t -> int)
25252626+(** [thumbnail_cmd handle] prints the thumbnail file path for a contact.
2727+2828+ Returns exit code 0 and prints the path if the contact has a thumbnail,
2929+ or exit code 1 if the contact is not found or has no thumbnail.
3030+3131+ @param handle The contact handle to look up *)
3232+val thumbnail_cmd : string -> (Xdge.t -> int)
3333+2634(** [search_cmd query] creates a command to search contacts by name.
27352836 @param query The search query string *)
···120128121129(** [show_info] is the command info for the show command. *)
122130val show_info : Cmdliner.Cmd.info
131131+132132+(** [thumbnail_info] is the command info for the thumbnail command. *)
133133+val thumbnail_info : Cmdliner.Cmd.info
123134124135(** [search_info] is the command info for the search command. *)
125136val search_info : Cmdliner.Cmd.info