Abandon $ for index field parameter, cmdliner complains
This commit is contained in:
parent
939087ccf7
commit
3545c3f19f
14
cli/index.ml
14
cli/index.ml
|
@ -41,13 +41,13 @@ type t = { dir : string; index_path: string; pck : Header_pack.t }
|
||||||
|
|
||||||
let index r print title auth locs peers =
|
let index r print title auth locs peers =
|
||||||
let edit name index param = if print then index else match param with
|
let edit name index param = if print then index else match param with
|
||||||
| Some "$" -> text_editor name index | Some p -> p
|
| Some "" -> text_editor name index | Some p -> p
|
||||||
| None -> index in
|
| None -> index in
|
||||||
let edits name index param = if print then index else match param with
|
let edits name index param = if print then index else match param with
|
||||||
| Some "$" -> text_editor_lines name index | Some p -> String_set.list_of_csv p
|
| Some "" -> text_editor_lines name index | Some p -> String_set.list_of_csv p
|
||||||
| None -> index in
|
| None -> index in
|
||||||
let edits_mp name index param = if print then index else match param with
|
let edits_mp name index param = if print then index else match param with
|
||||||
| Some "$" -> Header_pack.str_list (text_editor_lines name (Header_pack.to_str_list index))
|
| Some "" -> Header_pack.str_list (text_editor_lines name (Header_pack.to_str_list index))
|
||||||
| Some p -> Header_pack.str_list (String_set.list_of_csv p)
|
| Some p -> Header_pack.str_list (String_set.list_of_csv p)
|
||||||
| None -> index in
|
| None -> index in
|
||||||
let info = Header_pack.{ r.pck.info with
|
let info = Header_pack.{ r.pck.info with
|
||||||
|
@ -78,13 +78,13 @@ let load dir =
|
||||||
open Cmdliner
|
open Cmdliner
|
||||||
let term =
|
let term =
|
||||||
let print= Arg.(value & flag & info ["print"] ~doc:"print info") in
|
let print= Arg.(value & flag & info ["print"] ~doc:"print info") in
|
||||||
let title= Arg.(value & opt ~vopt:(Some "$") (some string) None & info ["t"; "title"]
|
let title= Arg.(value & opt ~vopt:(Some "") (some string) None & info ["t"; "title"]
|
||||||
~docv:"string" ~doc:"Title for index") in
|
~docv:"string" ~doc:"Title for index") in
|
||||||
let auth = Arg.(value & opt ~vopt:(Some "$") (some string) None & info ["a"; "authors"]
|
let auth = Arg.(value & opt ~vopt:(Some "") (some string) None & info ["a"; "authors"]
|
||||||
~docv:"comma-separated names" ~doc:"Index authors") in
|
~docv:"comma-separated names" ~doc:"Index authors") in
|
||||||
let locs = Arg.(value & opt ~vopt:(Some "$") (some string) None & info ["l"; "locations"]
|
let locs = Arg.(value & opt ~vopt:(Some "") (some string) None & info ["l"; "locations"]
|
||||||
~docv:"comma-separated URLs" ~doc:"repository URLs") in
|
~docv:"comma-separated URLs" ~doc:"repository URLs") in
|
||||||
let peers= Arg.(value & opt ~vopt:(Some "$") (some string) None & info ["p"; "peers"]
|
let peers= Arg.(value & opt ~vopt:(Some "") (some string) None & info ["p"; "peers"]
|
||||||
~docv:"comma-separated URLs" ~doc:"URLs to other known text repositories") in
|
~docv:"comma-separated URLs" ~doc:"URLs to other known text repositories") in
|
||||||
let dir = Arg.(value & pos 0 string "." & info []
|
let dir = Arg.(value & pos 0 string "." & info []
|
||||||
~docv:"directory to index") in
|
~docv:"directory to index") in
|
||||||
|
|
Loading…
Reference in New Issue