diff options
| author | Daniil Baturin <daniil@baturin.org> | 2017-01-16 14:45:20 +0700 |
|---|---|---|
| committer | Daniil Baturin <daniil@baturin.org> | 2017-01-16 14:45:20 +0700 |
| commit | 299f99bf2d4f5ea566088cce1992fa1b9a2c24be (patch) | |
| tree | 9e2b2af7fb8678be7b17f6762297cbbdc3d1fd73 /src/value_checker.ml | |
| parent | 9ffe1e87bb9ed5cec0eacecc43282e01e8d32829 (diff) | |
| download | vyconf-299f99bf2d4f5ea566088cce1992fa1b9a2c24be.tar.gz vyconf-299f99bf2d4f5ea566088cce1992fa1b9a2c24be.zip | |
Remove the assumptions about validator argument being mandatory.
Diffstat (limited to 'src/value_checker.ml')
| -rw-r--r-- | src/value_checker.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/value_checker.ml b/src/value_checker.ml index d4f0ddd..dad4596 100644 --- a/src/value_checker.ml +++ b/src/value_checker.ml @@ -1,6 +1,6 @@ module F = Filename -type value_constraint = Regex of string | External of string * string +type value_constraint = Regex of string | External of string * string option exception Bad_validator of string @@ -16,7 +16,8 @@ let validate_value dir value_constraint value = We should do something about it. *) let validator = F.concat dir v in - let result = Unix.system (Printf.sprintf "%s %s %s" validator c value) in + let arg = Util.substitute_default c "" in + let result = Unix.system (Printf.sprintf "%s %s %s" validator arg value) in match result with | Unix.WEXITED 0 -> true | Unix.WEXITED 127 -> raise (Bad_validator (Printf.sprintf "Could not execute validator %s" validator)) |
