Added ability to supply JSON from standard input

This commit is contained in:
2026-03-30 17:28:36 +03:00
parent a80e23614d
commit 6b22d8465e
4 changed files with 40 additions and 6 deletions

View File

@@ -60,8 +60,18 @@ int main(int argc, char **argv)
cfg_filename = argv[1];
}
// Read JSON CFG
ok = read_config_json(cfg, cfg_filename);
// Read config
if ("-" == cfg_filename)
{
// Read JSON from std input
ok = read_config_json(cfg, std::cin);
}
else
{
// Read JSON from config file
ok = read_config_json(cfg, cfg_filename);
}
if (!ok)
{
result = -1;