Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / inputrc.aug
1 (*
2 Module: Inputrc
3   Parses /etc/inputrc
4
5 Author: Raphael Pinson <raphink@gmail.com>
6
7 About: Reference
8   This lens tries to keep as close as possible to `man 3 readline` where possible.
9
10 About: License
11    This file is licenced under the LGPL v2+, 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/inputrc. See <filter>.
18
19 About: Examples
20    The <Test_Inputrc> file contains various examples and tests.
21 *)
22
23 module Inputrc =
24
25 autoload xfm
26
27 (* View: entry
28      An inputrc mapping entry *)
29 let entry =
30    let mapping = [ label "mapping" . store /[A-Za-z0-9_."\*\/+\,\\-]+/ ]
31    in [ label "entry"
32       . Util.del_str "\"" . store /[^" \t\n]+/
33       . Util.del_str "\":" . Sep.space
34       . mapping
35       . Util.eol ]
36
37 (* View: variable
38      An inputrc variable declaration *)
39 let variable = [ Util.del_str "set" . Sep.space
40                . key (Rx.word - "entry") . Sep.space
41                . store Rx.word . Util.eol ]
42
43 (* View: condition
44      An "if" declaration, recursive *)
45 let rec condition = [ Util.del_str "$if" . label "@if"
46                     . Sep.space . store Rx.space_in . Util.eol
47                     . (Util.empty | Util.comment | condition | variable | entry)*
48                     . [ Util.del_str "$else" . label "@else" . Util.eol
49                       . (Util.empty | Util.comment | condition | variable | entry)* ] ?
50                     . Util.del_str "$endif" . Util.eol ]
51
52 (* View: lns
53      The inputrc lens *)
54 let lns = (Util.empty | Util.comment | condition | variable | entry)*
55
56 (* Variable: filter *)
57 let filter = incl "/etc/inputrc"
58
59 let xfm = transform lns filter