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