2022-11-02 18:25:09 +03:00
|
|
|
#include <iostream>
|
2022-11-02 23:03:08 +03:00
|
|
|
#include "AugSettings.h"
|
|
|
|
#include "AugFuncs.h"
|
2022-11-02 22:17:51 +03:00
|
|
|
|
|
|
|
// 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();
|
2022-11-02 22:17:51 +03:00
|
|
|
|
2022-11-02 23:03:08 +03:00
|
|
|
auto testSettings = AugSettings {
|
|
|
|
.root = "../root",
|
|
|
|
.loadPath = "/opt/homebrew/share/augeas/lenses/dist",
|
|
|
|
};
|
|
|
|
|
|
|
|
auto instance = AugFuncs();
|
|
|
|
|
|
|
|
instance.printPreview(testSettings, "/files/etc/hosts/1", "/etc/hosts");
|
2022-11-02 22:17:51 +03:00
|
|
|
//printPreview("/files/etc/ssh/sshd_config/*", "/etc/ssh/sshd_config");
|
|
|
|
|
2022-11-02 23:03:08 +03:00
|
|
|
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;
|
|
|
|
}
|