Добавлена команда export для экспорта в архив tar.gz файлов указанного состояния снимка, по умолчанию экспортируется текущее состояние снимка
This commit is contained in:
parent
4301c27ca9
commit
4590ee5fbc
3 changed files with 72 additions and 11 deletions
20
source/app.d
20
source/app.d
|
@ -12,6 +12,16 @@ 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("diff", "Show changed data"))
|
||||
.add(new Command("export", "Export snapshot to a tar.gz archive")
|
||||
.add(new Argument("path", "Output directory path for the archive").required)
|
||||
.add(new Option("s", "snapshot", "Specify snapshot hash")
|
||||
.optional
|
||||
.validateEachWith(
|
||||
opt => opt.isValidHash,
|
||||
"must contain snapshot hash provided"
|
||||
)
|
||||
)
|
||||
)
|
||||
.add(new Command("create", "Create a new snapshot")
|
||||
.add(new Option("c", "comment", "Specify comment")
|
||||
.optional
|
||||
|
@ -50,7 +60,7 @@ int main(string[] args)
|
|||
)
|
||||
)
|
||||
.add(new Command("restore", "Restore to the specified snapshot state")
|
||||
.add(new Argument("hash", "hash").required)
|
||||
.add(new Argument("snapshot", "Specify snapshot hash").required)
|
||||
)
|
||||
.add(new Option("c", "config", "Сonfiguration file path")
|
||||
.optional
|
||||
|
@ -100,7 +110,13 @@ int main(string[] args)
|
|||
)
|
||||
)
|
||||
.on("restore", restore =>
|
||||
snag.restore(restore.arg("hash"))
|
||||
snag.restore(restore.arg("snapshot"))
|
||||
)
|
||||
.on("export", e =>
|
||||
snag.exportSnapshot(
|
||||
e.arg("path"),
|
||||
e.option("snapshot", ""),
|
||||
)
|
||||
);
|
||||
} catch (SnagException e) {
|
||||
e.print();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue