OCaml: Add noninteractive configuration key

This commit is contained in:
Juno Takano 2025-05-16 23:18:23 -03:00
commit 1f16024c9e
4 changed files with 28 additions and 4 deletions

View file

@ -30,6 +30,7 @@ let string_of_token (token: token): string =
| Key k -> (match k with
| SuCommand -> "[ KEY: su_command ]"
| SuCommandQuoted -> "[ KEY: su_command_quoted ]"
| Interactive -> " [ KEY: interactive ]"
| Unknown -> "[ UNKNOWN KEY ]")
| Equal -> "[ OP: equal ]"
| Value v -> "[ VAL: " ^ v ^ " ]"

View file

@ -38,6 +38,9 @@ let update config key (value: string): Schema.main =
| SuCommandQuoted ->
{ config with
Schema.su_command_quoted = parse_boolean key value }
| Interactive ->
{ config with
Schema.interactive = bool_of_string value }
| Unknown ->
elog ~context:Parsing $ "[c.parser.update] Dropped value: unknown key";
config