Добавлен флаг --snapshot для команды diff для просмотра изменений в конкретном снимке

This commit is contained in:
Alexander Zhirov 2025-06-07 18:32:45 +03:00
parent a711af3ec8
commit fa82b5c1eb
Signed by: alexander
GPG key ID: C8D8BE544A27C511
2 changed files with 45 additions and 10 deletions

View file

@ -39,7 +39,15 @@ int main(string[] args)
)
)
.add(new Command("status", "Checking the status of tracked files"))
.add(new Command("diff", "Show changed data"))
.add(new Command("diff", "Show changed data")
.add(new Option("s", "snapshot", "Specify snapshot hash")
.optional
.validateEachWith(
opt => opt.isValidHash,
"must contain snapshot hash provided"
)
)
)
.add(new Command("size", "Size of snapshots"))
.add(new Command("import", "Import snapshot from a tar.gz archive")
.add(new Argument("archive", "The path to the tar.gz archive file").required)
@ -167,7 +175,9 @@ int main(string[] args)
snag.initialize(init.flag("force"))
)
.on("diff", diff =>
snag.diff()
snag.diff(
diff.option("snapshot", "")
)
)
.on("size", size =>
snag.size()