[augeas-devel] Adding new lenses

David Lutterkort dlutter at redhat.com
Fri Mar 14 17:03:45 UTC 2008


On Fri, 2008-03-14 at 12:50 -0400, Bryan Kearney wrote:
> I tend to see both.

I agree that both uses are useful.

> However, to achieve that I think it would be nice to have lense "types". 
>   For example
> 
> foo.properties
> bar.properties
> JarJar.properties
> 
> all fllow the same structure. I would love for this to be one lens.
>   Or.. three files with an "is_a" relationship to a single grammer.

You can do that already: you can write a properties.aug file that just
has a grammar for Java properties files,
        grammar properties
        ...
        end

and the files foo-properties.aug, bar-properties.aug, ... that just have
a 'map' statement that applies that grammar

        map
          grammar properties
          include '/some/path/foo.properties' '/some/where/foo'
        end

or stick everything in one file; Augeas loads all *.aug files on
AUGEAS_SPEC_LIB and reads their grammars before it goes through the map
statements. Therefore, the order in which they are defined (or in which
files) does not matter.

David





More information about the augeas-devel mailing list