(* as \\w but:
* - no sequences of '_' longer than 1 are permitted
- * - no uppercase letter are permitted
*)
-let valid_step_rex_raw = "[a-z0-9]+\\(_[a-z0-9]+\\)*"
+let valid_step_rex_raw = "[a-zA-Z0-9]+\\(_[a-z0A-Z-9]+\\)*"
let valid_key_rex_raw =
sprintf "%s\(\\.%s\)*" valid_step_rex_raw valid_step_rex_raw
let valid_key_rex = Str.regexp ("^" ^ valid_key_rex_raw ^ "$")
let unset = Hashtbl.remove registry
-let env_var_of_key key =
- Str.global_replace dot_rex "__" (String.uppercase key)
+let env_var_of_key = Str.global_replace dot_rex "__"
let get key =
let rec aux stack key =
*
* key ::= path
* path ::= component ( '.' component )*
- * component ::= ( lowercase_alpha | num | '_' )+
+ * component ::= ( alpha | num | '_' )+
* # with the only exception that sequences of '_' longer than 1 aren't valid
* # components
*
* a configuration file (via "save_to" function below) .
*
* Mapping between keys and environment variables is as follows:
- * - the whole key is uppercased
* - each "." is converted to "__"
- * E.g.: my.foo_ish.application -> MY__FOO_ISH__APPLICATION
+ * E.g.: my.Foo_iSH.Application -> my__Foo_iSH__Application
*
* ++ Variable interpolation ++
*