claugeas/main.cpp

27 lines
754 B
C++
Raw Normal View History

2022-11-02 18:25:09 +03:00
#include <iostream>
#include "AugSettings.h"
#include "AugFuncs.h"
// Testing and training using augeas with C++
2022-11-02 19:27:57 +03:00
// https://github.com/hercules-team/augeas/blob/master/tests/test-api.c
2022-11-02 18:25:09 +03:00
2022-11-02 21:27:10 +03:00
2022-11-02 19:27:57 +03:00
int main(int argc, char *argv[]) {
2022-11-02 22:13:01 +03:00
//testGet();
auto testSettings = AugSettings {
.root = "../root",
.loadPath = "/opt/homebrew/share/augeas/lenses/dist",
};
auto instance = AugFuncs();
instance.printPreview(testSettings, "/files/etc/hosts/1", "/etc/hosts");
//printPreview("/files/etc/ssh/sshd_config/*", "/etc/ssh/sshd_config");
instance.printAugTree(testSettings, "/files/etc/hosts/*", "/etc/hosts");
instance.printAugTree(testSettings, "/files/etc/ssh/sshd_config/*", "/etc/ssh/sshd_config");
2022-11-02 22:13:01 +03:00
2022-11-02 18:25:09 +03:00
return 0;
}