diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-04-23 22:21:55 +0300 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-04-23 22:21:55 +0300 |
commit | 36e669345ecec7accd5dedf6099c9cce2e254063 (patch) | |
tree | c1844068fd8a497db1e7897f927d1e8f32b68510 /staging/smolblok/test/loader.cpp | |
parent | move subprojects/plugin_hostlist to plugins/smolblok_hostlist (diff) | |
download | smolbote-36e669345ecec7accd5dedf6099c9cce2e254063.tar.xz |
Add smolblok-load utility
Diffstat (limited to 'staging/smolblok/test/loader.cpp')
-rw-r--r-- | staging/smolblok/test/loader.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/staging/smolblok/test/loader.cpp b/staging/smolblok/test/loader.cpp new file mode 100644 index 0000000..9e27a26 --- /dev/null +++ b/staging/smolblok/test/loader.cpp @@ -0,0 +1,25 @@ +#include "smolblok.hpp" +#include <spdlog/spdlog.h> + +int main(int argc, char** argv) +{ + if(argc != 2) { + spdlog::error("usage: {} path/to/plugin.so", argv[0]); + return -1; + } + + smolblok filter; + { + const auto r = filter.registerFormatPlugin("unused", argv[1]); + if(r.loaded) { + spdlog::info("Loaded plugin {}", argv[1]); + } else { + spdlog::error("Failed loading plugin {}", argv[1]); + spdlog::error(qUtf8Printable(r.error)); + return -1; + } + } + + return 0; +} + |