[augeas-devel] augsuggest - an Augeas tool for creating idempotent augtool scripts
George Hansper
george-augeas at hansper.id.au
Tue Oct 25 19:48:41 UTC 2022
Hi All,
I'm thinking that the original name *augprint* is easier to remember and
also seems to describe what the tool is doing, more so than augsuggest
I think I should rename this back to augprint even though it does more
than just the "print" a pathfrom augtool.
If run with -v or --verbose augprint (aka augsuggest) will output the
corresponding path+value from the augtool 'print' command, as comments.
So there is a strong correlation with 'print'.
Any thoughts or objections to renaming using augprint in preference to
augsuggest ?
Regards,
George Hansper
On 17/2/22 20:41, George Hansper wrote:
> Hi All,
>
> I have re-written the existing Python program "augprint.py" in C.
>
> I've called the new tool "augsuggest", and it is currently available
> from:
>
> https://github.com/georgehansper/augsuggest.c
>
> Like augprint.py, augsuggest creates an augtool script for a given file.
>
> The resulting script is intended to
>
> - be able to recreate the original file
> - make no changes if applied to the original file
> - use path-expressions in preference to position-numbers
>
> The resulting script requires Augeas version 1.13.0 to work properly,
> but the output can still be a useful starting point when used with
> earlier versions of Augeas.
>
> For example, given a file /etc/hosts with the contents:
>
> 127.0.0.1 localhost localhost.localdomain localhost4
>
> augsuggest will produce the following output:
>
>
> set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/ipaddr '127.0.0.1'
> set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/canonical 'localhost'
> set
> /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/alias[.='localhost.localdomain']
> 'localhost.localdomain'
> set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/alias[.='localhost4']
> 'localhost4'
>
>
> This output can be used to create idempotent augtool scripts with
> little or no further editing when used with Augeas 1.13.0 or later.
>
> For further details, see: https://github.com/georgehansper/augsuggest.c
>
> Regards,
>
> George Hansper
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20221026/46a5df9b/attachment.htm>
More information about the augeas-devel
mailing list