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:
894 bytes
|
Rev | Line | |
---|
[73] | 1 | open Kosuzu
|
---|
| 2 | let file files =
|
---|
| 3 | let dirs, files = File_store.split_filetypes files in
|
---|
| 4 | let _link_as_named dir file = Unix.link file (Filename.concat dir file) in
|
---|
| 5 | let link_with_id dir file =
|
---|
| 6 | match File_store.to_text file with Error s -> prerr_endline s
|
---|
| 7 | | Ok t -> Unix.link file (Filename.concat dir (Text.short_id t^".txt")) in
|
---|
| 8 | let link = link_with_id in
|
---|
| 9 | List.iter (fun d -> List.iter (link d) files) dirs
|
---|
| 10 |
|
---|
| 11 | open Cmdliner
|
---|
| 12 | let files = Arg.(value & pos_all string [] & info [] ~docv: "Text filenames and subdirectories")
|
---|
| 13 | let file_t = Term.(const file $ files)
|
---|
| 14 |
|
---|
| 15 | let cmd =
|
---|
| 16 | let doc = "File texts in subdirectories" in
|
---|
| 17 | let man = [
|
---|
| 18 | `S Manpage.s_description;
|
---|
| 19 | `P "Files all texts in parameter in every directory in parameter, using hardlinks";
|
---|
| 20 | `P "Use it to create sub-repositories for sharing or converting" ]
|
---|
| 21 | in
|
---|
| 22 | let info = Cmd.info "file" ~doc ~man in
|
---|
| 23 | Cmd.v info file_t
|
---|
Note:
See
TracBrowser
for help on using the repository browser.