Imported Upstream version 1.7.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 let flag = [ key /[A-Za-z0-9._-]+(\[[0-9]+\])?/ . Util.doseol ]
28
29 (************************************************************************
30  *                                LENS
31  *************************************************************************)
32
33 let lns = (comment|empty|entry|flag)*
34
35 let simple_lns = lns    (* An alias for compatibility reasons *)
36
37 (* configuration files that can be parsed without customizing the lens *)
38 let filter = incl "/etc/havp/havp.config"
39            . incl "/etc/ldap.conf"
40            . incl "/etc/ldap/ldap.conf"
41            . incl "/etc/libnss-ldap.conf"
42            . incl "/etc/pam_ldap.conf"
43
44 let xfm = transform lns filter