snag/source/app.d
Alexander Zhirov ff887e0640
Сформирован базовый механизм чтения конфигурационного файла.
Необходимо читать файл конфигурации, который будет содержать пути к репозиторию git и проекту для отслеживания.
2025-05-23 02:10:07 +03:00

27 lines
564 B
D
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import snapd;
import commandr;
import std.file;
import core.stdc.stdlib : EXIT_SUCCESS;
private string programName = "snapd";
int main(string[] args)
{
auto argumets = new Program(programName, snapdVersion)
.add(new Option("c", "config", "Сonfiguration file path")
.optional
.validateEachWith(
opt => opt.exists && opt.isFile,
"A JSON file path must be provided"
)
)
.parse(args);
string configFile = "snapd.json";
configFile = argumets.option("config", configFile);
auto sc = new SnapdConfig(configFile);
return EXIT_SUCCESS;
}