Reimplemented txt-init in OCaml
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja> git-svn-id: file:///srv/svn/repo/kosuzu/trunk@72 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
4
init/dune
Normal file
4
init/dune
Normal file
@@ -0,0 +1,4 @@
|
||||
(executable
|
||||
(name init)
|
||||
(public_name txt_init)
|
||||
(libraries logarion))
|
||||
18
init/init.ml
Normal file
18
init/init.ml
Normal file
@@ -0,0 +1,18 @@
|
||||
open Logarion
|
||||
let init_repo =
|
||||
print_endline "No txt.conf found";
|
||||
print_endline "It's required for the repository name and id.";
|
||||
print_endline "Create one? (y/n)";
|
||||
match input_line stdin with
|
||||
|"y"->
|
||||
let title =
|
||||
print_endline "Title for repository: ";
|
||||
input_line stdin in
|
||||
let authors =
|
||||
print_endline "Authors (format: name <name@email> <http://website>): ";
|
||||
input_line stdin in
|
||||
Logarion.File_store.file "txt.conf"
|
||||
(Printf.sprintf "Id:%s\nTitle: %s\nAuthors: %s\n" (Logarion.Id.generate ()) title authors);
|
||||
Logarion.File_store.of_kv_file ()
|
||||
| _ ->
|
||||
print_endline "Aborting..."; exit 1
|
||||
Reference in New Issue
Block a user