[MOD] Read the config file for tool DB access

This commit is contained in:
LDA 2024-09-08 16:12:27 +02:00
commit 9775bd8d4e
6 changed files with 157 additions and 115 deletions

View file

@ -3,12 +3,7 @@
* Under CC0, as its a rather useful example of a Parsee tool.
* See LICENSE for more information about Parsee's licensing. */
#include <Cytoplasm/Memory.h>
#include <Cytoplasm/Json.h>
#include <Cytoplasm/Log.h>
#include <Cytoplasm/Db.h>
#include <stdlib.h>
#include "common.h"
int
Main(Array *args, HashMap *env)
@ -20,13 +15,13 @@ Main(Array *args, HashMap *env)
if (ArraySize(args) < 2)
{
Log(LOG_ERR, "Usage: %s [DB path]", exec);
Log(LOG_ERR, "Usage: %s [config]", exec);
return EXIT_FAILURE;
}
db_path = ArrayGet(args, 1);
parsee = DbOpenLMDB(db_path, 8 * 1024 * 1024);
parsee = GetDB(db_path);
if (parsee)
{
DbDelete(parsee, 1, "avatars");