This commit is contained in:
Alexander Zhirov 2025-05-24 22:01:59 +03:00
parent a193f53871
commit fe55e8680f
Signed by: alexander
GPG key ID: C8D8BE544A27C511
4 changed files with 24 additions and 13 deletions

3
.vscode/launch.json vendored
View file

@ -10,7 +10,8 @@
"dubBuild": true,
"name": "Build & Debug DUB project",
"cwd": "${command:dubWorkingDirectory}",
"program": "bin/${command:dubTarget}"
"program": "bin/${command:dubTarget}",
"args": ["list"]
}
]
}

View file

@ -1,6 +1,6 @@
{
"git": "/tmp/testgit",
"project": "/home/alexander/Programming/new/dlang/snag/source",
"project": "/tmp/test",
"email": "user@site.domain",
"user": "snag",
"presnag": [

View file

@ -12,6 +12,10 @@ int main(string[] args)
.add(new Command("init", "Initializing the repository for storing snapshots"))
.add(new Command("status", "Checking the status of tracked files"))
.add(new Command("create", "Create a new backup"))
.add(new Command("list", "List of backups"))
.add(new Command("restore", "Restore to the specified snapshot state")
.add(new Argument("hash", "hash").required)
)
.add(new Option("c", "config", "Сonfiguration file path")
.optional
.validateEachWith(
@ -33,18 +37,24 @@ int main(string[] args)
}
auto snag = new Snag(config);
import std.stdio;
try {
argumets
.on("init", (init) {
snag.initialize();
})
.on("status", (status) {
snag.status();
})
.on("create", (create) {
snag.create();
});
.on("init", init =>
snag.initialize()
)
.on("status", status =>
snag.status()
)
.on("create", create =>
snag.create()
)
.on("list", list =>
snag.list()
)
.on("restore", restore =>
snag.restore(restore.arg("hash"))
);
} catch (SnagException e) {
e.print();
return EXIT_FAILURE;

View file

@ -1,3 +1,3 @@
module snag.version_;
enum snagVersion = "0.0.4";
enum snagVersion = "0.0.5";