[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[augeas-devel] Fwd: case-like solution?



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

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




On Tue, Dec 29, 2009 at 4:15 PM, Tim Stoop <tim stoop gmail com> 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





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]