# Approx

Parses /etc/approx/approx.conf

Author: David Lutterkort lut.nosp@m.ter@redha.nosp@m.t.com

Summary

Approx | Parses /etc/approx/approx.conf
Reference | This lens tries to keep as close as possible to `man 5 approx.conf` where possible.
License | This file is licenced under the LGPL v2+, like the rest of Augeas.
Lens Usage | See lns.
Configuration files | This lens applies to /etc/approx/approx.conf.
Examples | The Test_Approx file contains various examples and tests.
Augeas Variables |
eol | An Util.eol
indent | An Util.indent
key_re |
sep |
value_re |
Augeas Lenses |
comment |
empty | An Util.empty
kv |
lns |
filter |

### Reference

This lens tries to keep as close as possible to `man 5 approx.conf` where possible.

### License

This file is licenced under the LGPL v2+, like the rest of Augeas.

### Lens Usage

See lns.

### Configuration files

This lens applies to /etc/approx/approx.conf.

### Examples

The Test_Approx file contains various examples and tests.

### Augeas Variables

### eol

> let eol = Util.eol

An Util.eol

### indent

> let indent = Util.indent

An Util.indent

### key_re

> let key_re = /\$?[A-Za-z0-9_.-]+/

### sep

> let sep = /[ \t]+/

### value_re

> let value_re = /[^ \t\n](.*[^ \t\n])?/

### Augeas Lenses

### comment

> let comment = [ indent . label "#comment" . del /[#;][ \t]*/ "# " . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]

### empty

> let empty = Util.empty

An Util.empty

### kv

> let kv = [ indent . key key_re . del sep " " . store value_re . eol ]

### lns

> let lns = (empty | comment | kv) *

### filter

> let lns = (empty | comment | kv) *

Provides unit tests and examples for the Approx lens.

> let eol = Util.eol

An Util.eol

> let eol = del /[ \t]*\n/ "\n"

Delete end of line, including optional trailing whitespace

> let indent = Util.indent

An Util.indent

> let indent = del /[ \t]*/ ""

Delete indentation, including leading whitespace

> let key_re = /\$?[A-Za-z0-9_.-]+/

> let sep = /[ \t]+/

> let value_re = /[^ \t\n](.*[^ \t\n])?/

> let comment = [ indent . label "#comment" . del /[#;][ \t]*/ "# " . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]

> let empty = Util.empty

An Util.empty

> let empty = empty_generic empty_generic_re

Map empty lines, including empty comments

> let kv = [ indent . key key_re . del sep " " . store value_re . eol ]

Close