#include <softbus_daemon/core/CoreService.h>

#include <iostream>
#include <string>

int main(int argc, char* argv[])
{
    std::string profilePath = "config/daemon_profile.json";
    std::string pointTablePath = "config/point_table.json";
    bool selfTest = false;

    for (int i = 1; i < argc; ++i) {
        const std::string arg = argv[i];
        if (arg == "--config" && i + 1 < argc) {
            profilePath = argv[++i];
        } else if ((arg == "--point-table" || arg == "--model") && i + 1 < argc) {
            pointTablePath = argv[++i];
        } else if (arg == "--self-test") {
            selfTest = true;
        }
    }

    softbus::daemon::CoreService service;
    if (!service.start(profilePath, pointTablePath)) {
        std::cerr << "Failed to start softbus_daemon" << std::endl;
        return 1;
    }
    service.run(selfTest);
    return 0;
}
