Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / backuppchosts.aug
1 (*
2 Module: BackupPCHosts
3   Parses /etc/backuppc/hosts
4
5 About: Reference
6   This lens tries to keep as close as possible to `man backuppc` where possible.
7
8 About: License
9    This file is licenced under the LGPL v2+, like the rest of Augeas.
10
11 About: Lens Usage
12    To be documented
13
14 About: Configuration files
15    This lens applies to /etc/backuppc/hosts. See <filter>.
16 *)
17
18 module BackupPCHosts =
19 autoload xfm
20
21 (* View: word *)
22 let word = /[^#, \n\t\/]+/
23
24 (* View: record *)
25 let record =
26   let moreusers = Build.opt_list [ label "moreusers" . store word ] Sep.comma in
27               [ seq "host"
28               . [ label "host" . store word ] . Util.del_ws_tab
29               . [ label "dhcp" . store word ] . Util.del_ws_tab
30               . [ label "user" . store word ]
31               . (Util.del_ws_tab . moreusers)?
32               . (Util.comment|Util.eol) ]
33
34 (* View: lns *)
35 let lns = ( Util.empty | Util.comment | record ) *
36
37 (* View: filter *)
38 let filter = incl "/etc/backuppc/hosts"
39
40 let xfm = transform lns filter