ansible-augeas icon indicating copy to clipboard operation
ansible-augeas copied to clipboard

Add "edit" command

Open javiplx opened this issue 9 years ago • 3 comments

This change adds an "edit" command, which is basically an ins+set. The main changes respect to the use of both commands in sequence is that the node is not inserted if it already exists (so, "edit" is not usable for labels with multiple entries). And it also adds a "comment" flag which search for a comment with the label on it, and insert the new node after it. This means that

command=edit label=remote_user comment=True ...

will insert the node after

# remote_user = ...

if that line exists, and after path if not. I've used this only on .ini files up to now, but should work in the general case.

javiplx avatar Feb 22 '16 17:02 javiplx

@javiplx, please give me a few hours (I hope I will find them this evening), so I can read and test your propositions.

paluh avatar Feb 22 '16 17:02 paluh

No hurry from my side, as I'm already using it ...

javiplx avatar Feb 22 '16 17:02 javiplx

Any news on this?

jippi avatar Apr 11 '17 09:04 jippi