Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / vfstab.aug
1 (*
2 Module: Vfstab
3   Parses Solaris vfstab config file, based on Fstab lens
4
5 Author: Dominic Cleal <dcleal@redhat.com>
6
7 About: Reference
8   See vfstab(4)
9
10 About: License
11    This file is licenced under the LGPLv2+, like the rest of Augeas.
12
13 About: Lens Usage
14    To be documented
15
16 About: Configuration files
17    This lens applies to /etc/vfstab.
18
19 About: Examples
20    The <Test_Vfstab> file contains various examples and tests.
21 *)
22
23 module Vfstab =
24   autoload xfm
25
26   let sep_tab = Sep.tab
27   let sep_spc = Sep.space
28   let comma   = Sep.comma
29   let eol     = Util.eol
30
31   let comment = Util.comment
32   let empty   = Util.empty
33
34   let file    = /[^# \t\n]+/
35
36   let int     = Rx.integer
37   let bool    = "yes" | "no"
38
39   (* An option label can't contain comma, comment, equals, or space *)
40   let optlabel = /[^,#= \n\t]+/ - "-"
41   let spec    = /[^-,# \n\t][^ \n\t]*/
42
43   let optional = Util.del_str "-"
44
45   let comma_sep_list (l:string) =
46     let value = [ label "value" . Util.del_str "=" . store Rx.neg1 ] in
47       let lns = [ label l . store optlabel . value? ] in
48          Build.opt_list lns comma
49
50   let record = [ seq "mntent" .
51                    [ label "spec" . store spec ] . sep_tab .
52                    ( [ label "fsck" . store spec ] | optional ). sep_tab .
53                    [ label "file" . store file ] . sep_tab .
54                    comma_sep_list "vfstype" . sep_tab .
55                    ( [ label "passno" . store int ] | optional ) . sep_spc .
56                    [ label "atboot" . store bool ] . sep_tab .
57                    ( comma_sep_list "opt" | optional ) .
58                    eol ]
59
60   let lns = ( empty | comment | record ) *
61   let filter = incl "/etc/vfstab"
62
63   let xfm = transform lns filter
64
65 (* Local Variables: *)
66 (* mode: caml *)
67 (* End: *)