Changeset 66 in code for trunk/cli/file.ml


Ignore:
Timestamp:
Aug 21, 2024, 1:37:05 AM (8 months ago)
Author:
Izuru Yakumo
Message:

Migrate the codebase to the latest revision of Cmdliner

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/file.ml

    r65 r66  
    99        List.iter (fun d -> List.iter (link d) files) dirs
    1010
    11 let unfile files =
    12         let dirs, files = File_store.split_filetypes files in
    13         let unlink dir file = try Unix.unlink (Filename.concat dir file)
    14                 with Unix.(Unix_error(ENOENT,_,_))-> () in
    15         List.iter (fun d -> List.iter (unlink d) files) dirs
     11open Cmdliner
     12let files = Arg.(value & pos_all string [] & info [] ~docv: "Text filenames and subdirectories")
     13let file_t = Term.(const file $ files)
    1614
    17 open Ocmd
    18 let term =
    19         let files = Arg.(value & pos_all string [] & info []
    20                 ~docv:"text filenames and subdirectories") in
    21         Term.(const file $ files), Term.info "file"
    22                 ~doc:"file texts in subdirectories"
    23                 ~man:[ `S "DESCRIPTION"; `P "Files all texts in parameter in every
    24                 directory in parameter, using hardlinks.
    25 
    26                 Use it to create sub-repositories for sharing or converting" ]
    27 
    28 let unfile_term =
    29         let files = Arg.(value & pos_all string [] & info []
    30                 ~docv:"text filenames and subdirectories") in
    31         Term.(const unfile $ files), Term.info "unfile"
    32                 ~doc:"unfile texts from subdirectories"
    33                 ~man:[ `S "DESCRIPTION"; `P "unfile texts in parameter from
    34         directories in parameter, by removing hardlinks" ]
     15let 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" ~version:"%%VERSION%%" ~doc ~man in
     23  Cmd.v info file_t
Note: See TracChangeset for help on using the changeset viewer.