Migrate the codebase to the latest revision of Cmdliner
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja> git-svn-id: file:///srv/svn/repo/kosuzu/trunk@66 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
21
cli/unfile.ml
Normal file
21
cli/unfile.ml
Normal file
@@ -0,0 +1,21 @@
|
||||
open Logarion
|
||||
|
||||
let unfile files =
|
||||
let dirs, files = File_store.split_filetypes files in
|
||||
let unlink dir file = try Unix.unlink (Filename.concat dir file) with
|
||||
Unix.(Unix_error(ENOENT,_,_))-> () in
|
||||
List.iter (fun d -> List.iter (unlink d) files) dirs
|
||||
|
||||
open Cmdliner
|
||||
let files = Arg.(value & pos_all string [] & info [] ~docv: "Text filenames and subdirectories")
|
||||
|
||||
let unfile_t = Term.(const unfile $ files)
|
||||
|
||||
let cmd =
|
||||
let doc = "Unfile texts from subdirectories" in
|
||||
let man = [
|
||||
`S Manpage.s_description;
|
||||
`P "Unfile texts in parameter from directories in parameter, by removing hardlinks" ]
|
||||
in
|
||||
let info = Cmd.info "unfile" ~version:"%%VERSION%%" ~doc ~man in
|
||||
Cmd.v info unfile_t
|
||||
Reference in New Issue
Block a user