Added ability to supply JSON from standard input
This commit is contained in:
14
main.cpp
14
main.cpp
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user