5 Author: Raphael Pinson <raphink@gmail.com>
8 This lens tries to keep as close as possible to `man 5 host.conf` where possible.
11 This file is licenced under the LGPL v2+, like the rest of Augeas.
16 About: Configuration files
17 This lens applies to /etc/host.conf. See <filter>.
24 (************************************************************************
26 *************************************************************************)
29 Store a boolean value *)
30 let sto_bool = store ("on"|"off")
32 (* View: sto_bool_warn
33 Store a boolean value *)
34 let sto_bool_warn = store ("on"|"off"|"warn"|"nowarn")
38 let bool (kw:regexp) = Build.key_value_line kw Sep.space sto_bool
41 A boolean switch with extended values *)
42 let bool_warn (kw:regexp) = Build.key_value_line kw Sep.space sto_bool_warn
46 let list (kw:regexp) (elem:string) =
47 let list_elems = Build.opt_list [seq elem . store Rx.word] (Sep.comma) in
48 Build.key_value_line kw Sep.space list_elems
52 let trim_list = Build.opt_list [seq "trim" . store Rx.word] (del /[:;,]/ ":") in
53 Build.key_value_line "trim" Sep.space trim_list
56 let entry = bool ("multi"|"nospoof"|"spoofalert"|"reorder")
58 | list "order" "order"
61 (************************************************************************
62 * Group: LENS AND FILTER
63 *************************************************************************)
66 let lns = ( Util.empty | Util.comment | entry )*
69 let filter = incl "/etc/host.conf"
71 let xfm = transform lns filter