[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need 'UncommentAndSetValue' or some such
From: |
David Scott Coburn |
Subject: |
Re: Need 'UncommentAndSetValue' or some such |
Date: |
Wed, 26 Oct 2005 10:09:52 -0400 |
User-agent: |
KNode/0.8.2 |
Brendan Strejcek wrote:
> This is a commonly requested feature, check the archives for the
> discussions.
>
> This is what I find myself doing these days:
>
> editfiles:
> { /some/file
> DeleteLinesStarting "SomeVar" # Or Matching, whatever
> AppendIfNoSuchLine "SomeVar = SomeValue"
> }
>
> This is perfectly convergent because cfagent edits the file in a buffer
> and then compares to contents on disk. If there is no difference, the
> actual file is not touched.
This is an improvement, but it would be nice if the edit did not move
the line you are editing to the end of the file. Usually there is some
context of comments related to the variable you are setting. The function
which edits and sets the variable should not change this. This makes it
easier to look through the file if needed to find the line you are looking
for, to see what the settings are, and to reference the information in the
comments.
Scott
--
* David Scott Coburn
* Brookhaven National Laboratory
* scott@bnl.gov 631.344.7110
* "Assume a spherical cow of uniform density..."
- Re: Need 'UncommentAndSetValue' or some such, (continued)
- Message not available
- Re: Need 'UncommentAndSetValue' or some such,
David Scott Coburn <=
- Message not available
- Re: Need 'UncommentAndSetValue' or some such, Christopher Browne, 2005/10/26
- Re: Need 'UncommentAndSetValue' or some such, David Scott Coburn, 2005/10/27
- Re: Need 'UncommentAndSetValue' or some such, Paul Krizak, 2005/10/27
- Re: Need 'UncommentAndSetValue' or some such, Luke Kanies, 2005/10/27
- Re: Need 'UncommentAndSetValue' or some such, Paul Krizak, 2005/10/27
- Re: Need 'UncommentAndSetValue' or some such, Luke Kanies, 2005/10/27
- Re: Need 'UncommentAndSetValue' or some such, Brendan Strejcek, 2005/10/27
- Re: Need 'UncommentAndSetValue' or some such, Luke Kanies, 2005/10/27
- Re: Need 'UncommentAndSetValue' or some such, Brendan Strejcek, 2005/10/28