This patch attempts to address #216, supporting a root context for all relative paths passed into the API.
It was intended to mirror Puppet's "context" property, but implemented in Augeas itself so relative paths can be passed into aug_srun. Relative paths are defined as those that don't start with "/" or "//" (the latter to keep backwards-compatibility, will always refer to a descendant of root). The context is stored in /augeas/context and can be modified with the usual commands. It's parsed as a full path expression, but must evaluate to a single node. It defaults to "/files". The second patch makes tab completion work in augtool as a user might expect, so it's aware now of the context. Feedback's appreciated. Thanks, Dominic src/augeas.c | 84 +++++++++++++++++++++++++++++++++++++++++------------ src/augeas.h | 2 +- src/augtool.c | 34 +++++++++++++++++++-- src/builtin.c | 2 +- src/internal.h | 18 +++++++++++- src/pathx.c | 48 +++++++++++++++++++++++++++++- src/transform.c | 4 +- tests/test-api.c | 48 ++++++++++++++++++++++++++++++ tests/xpath.tests | 7 ++++ 9 files changed, 218 insertions(+), 29 deletions(-) _______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
