Imported Upstream version 1.3.0
[platform/upstream/augeas.git] / lenses / dnsmasq.aug
1 (* Dnsmasq module for Augeas
2  Author: Free Ekanayaka <free@64studio.com>
3
4  Reference: man dnsmasq (8)
5
6  "Format is one option per line, legal options are the same
7   as the long options legal on the command line. See
8  "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details."
9
10 *)
11
12 module Dnsmasq =
13
14    autoload xfm
15
16 (************************************************************************
17  *                           USEFUL PRIMITIVES
18  *************************************************************************)
19
20 let eol        = Util.eol
21 let spc        = Util.del_ws_spc
22 let comment    = Util.comment
23 let empty      = Util.empty
24
25 let sep_eq     = del /=/ "="
26 let sto_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/
27
28 (************************************************************************
29  *                               ENTRIES
30  *************************************************************************)
31
32 let entry_re   = /[A-Za-z0-9._-]+/
33 let entry      = [ key entry_re . (sep_eq . sto_to_eol)? . eol ]
34
35 (************************************************************************
36  *                                LENS
37  *************************************************************************)
38
39 let lns = (comment|empty|entry) *
40
41 let filter            = incl "/etc/dnsmasq.conf"
42                       . incl "/etc/dnsmasq.d/*"
43                       . excl ".*"
44                       . Util.stdexcl
45
46 let xfm                = transform lns filter