|
@@ -16,12 +16,21 @@
|
|
int main(int argc , char* argv[])
|
|
int main(int argc , char* argv[])
|
|
{
|
|
{
|
|
plog::init(plog::info, "log/vsp.log", 1000000, 5);
|
|
plog::init(plog::info, "log/vsp.log", 1000000, 5);
|
|
- if (argc < 2) {
|
|
|
|
- std::cerr << "Usage: " << argv[0] << " <json_path>" << std::endl;
|
|
|
|
|
|
+ if (argc < 3) {
|
|
|
|
+ std::cerr << "Usage: " << argv[0] << " <config_path>" << std::endl;
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
- const char* json_path = argv[1];
|
|
|
|
|
|
+ const char* config_path = argv[1];
|
|
|
|
+ const char* config_type = argv[2];
|
|
Pipe::PipelineManager pipeline_manager;
|
|
Pipe::PipelineManager pipeline_manager;
|
|
|
|
+ if (std::string(config_type) == "yaml") {
|
|
|
|
+ pipeline_manager.create_from_yaml(std::string(config_path));
|
|
|
|
+ } else if (std::string(config_type) == "json") {
|
|
|
|
+ pipeline_manager.create_from_json(std::string(config_path));
|
|
|
|
+ } else {
|
|
|
|
+ std::cerr << "Unknown config type: " << config_type << std::endl;
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
pipeline_manager.create_from_json(std::string(json_path));
|
|
pipeline_manager.create_from_json(std::string(json_path));
|
|
|
|
|
|
for (const auto& p : pipeline_manager.getPipelines()) {
|
|
for (const auto& p : pipeline_manager.getPipelines()) {
|