fix kudos name; add check in parse_config
This commit is contained in:
parent
96ac74a0ab
commit
b7e48641a5
4 changed files with 40 additions and 26 deletions
|
|
@ -178,7 +178,22 @@ let yes_no = function
|
|||
| s -> fail "expected `YES`/`NO` value, got `%s`" s
|
||||
|
||||
let uri s = Uri.of_string s
|
||||
let amount s = s |> Amount.of_string |> unwrap
|
||||
|
||||
let amount =
|
||||
let currency = ref None in
|
||||
fun s ->
|
||||
let amount = s |> Amount.of_string |> unwrap in
|
||||
match !currency with
|
||||
| None ->
|
||||
currency := Some amount.currency;
|
||||
amount
|
||||
| Some cur -> (
|
||||
match String.equal amount.currency cur with
|
||||
| false ->
|
||||
fail "only one kind of currency is supported, found: `%s` and `%s`."
|
||||
amount.currency cur
|
||||
| true -> amount)
|
||||
|
||||
let duration s = Config_duration.(s |> parse |> to_time_span)
|
||||
|
||||
let ed25519 s =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue