Sorry, I had answered Tim and forgot to put the list in copy.

---------- Forwarded message ----------
From: Raphaël Pinson <[email protected]>
Date: 2009/12/29
Subject: Re: [augeas-devel] case-like solution?
To: Tim Stoop <[email protected]>




On Tue, Dec 29, 2009 at 4:15 PM, Tim Stoop <[email protected]> wrote:

> Hi all,
>
> I'm trying my hand at writing a lens that would allow me the create
> mod_rewrite rules (including conditions) in a file. I'm having a
> little trouble defining the following:
>
> If the RewriteCond line ends in "[OR]", I need the "chain_as" item to
> have the value "or", but if there's nothing at the end of the line, I
> want the chain_as value to be defined as "and". Any hints on how to do
> this?
>
> It's but a first attempt, but once I have it working more or less,
> I'll post it here, of course. Not sure if anyone else could use such a
> specific lens.
>
>

Something like this (not tested):


   let chain_as = [
           label "chain_as"
              . ( value "or" . del "[OR]" "[OR]" ) | ( value "and" )
       ]

   let line = whatever . chain_as . eol



Raphaël
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to