Imported Upstream version 1.4.0
[platform/upstream/augeas.git] / lenses / spacevars.aug
1 (* Spacevars module for Augeas
2  Author: Free Ekanayaka <free@64studio.com>
3
4  Reference: man interfaces
5  This is a generic lens for simple key/value configuration files where
6  keys and values are separated by a sequence of spaces or tabs.
7
8 *)
9
10 module Spacevars =
11   autoload xfm
12
13 (************************************************************************
14  *                           USEFUL PRIMITIVES
15  *************************************************************************)
16
17 let comment = Util.comment
18 let empty   = Util.empty
19
20 (************************************************************************
21  *                               ENTRIES
22  *************************************************************************)
23
24
25 let entry = Build.key_ws_value /[A-Za-z0-9._-]+(\[[0-9]+\])?/
26
27 (************************************************************************
28  *                                LENS
29  *************************************************************************)
30
31 let lns = (comment|empty|entry)*
32
33 let simple_lns = lns    (* An alias for compatibility reasons *)
34
35 (* configuration files that can be parsed without customizing the lens *)
36 let filter = incl "/etc/havp/havp.config"
37            . incl "/etc/ldap.conf"
38            . incl "/etc/ldap/ldap.conf"
39            . incl "/etc/libnss-ldap.conf"
40            . incl "/etc/pam_ldap.conf"
41
42 let xfm = transform lns filter