From fe55e8680fd9543d3e310f6ca5c9bde4cc4868dc Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Sat, 24 May 2025 22:01:59 +0300 Subject: [PATCH] 0.0.5 --- .vscode/launch.json | 3 ++- snag.json | 2 +- source/app.d | 30 ++++++++++++++++++++---------- source/snag/version_.d | 2 +- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 400e7c1..03d6784 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,8 @@ "dubBuild": true, "name": "Build & Debug DUB project", "cwd": "${command:dubWorkingDirectory}", - "program": "bin/${command:dubTarget}" + "program": "bin/${command:dubTarget}", + "args": ["list"] } ] } \ No newline at end of file diff --git a/snag.json b/snag.json index f7d3e00..42a6ae2 100644 --- a/snag.json +++ b/snag.json @@ -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": [ diff --git a/source/app.d b/source/app.d index f3bf551..d0ff61d 100644 --- a/source/app.d +++ b/source/app.d @@ -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; diff --git a/source/snag/version_.d b/source/snag/version_.d index 2465932..2d93c85 100644 --- a/source/snag/version_.d +++ b/source/snag/version_.d @@ -1,3 +1,3 @@ module snag.version_; -enum snagVersion = "0.0.4"; +enum snagVersion = "0.0.5";