Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ Usage: discloud snapshot download [arguments]
-h, --help Print this usage information.
--app (mandatory)
--version Snapshot version in YYYYMMDD-HHMMSS format
-d, --dir Specifies the destination path for downloading backups. The destination path will be considered a directory.
```

#### snapshot info
Expand Down
11 changes: 8 additions & 3 deletions lib/commands/snapshot/download.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ import "package:discloud/utils/download.dart";
import "package:discloud/utils/messages.dart";
import "package:discloud/utils/progress.dart";
import "package:discloud/utils/speed_monitor.dart";
import "package:path/path.dart" hide context;

final class SnapshotDownloadCommand extends Command<void> with Disposable {
SnapshotDownloadCommand() {
argParser
..addOption("app", mandatory: true)
..addOption("version", help: "Snapshot version in YYYYMMDD-HHMMSS format")
..addOption(
"version",
help: "Snapshot version in YYYYMMDD-HHMMSS format",
"dir",
abbr: "d",
aliases: const ["out"],
help:
"Specifies the destination path for downloading backups. The destination path will be considered a directory.",
);
}

Expand Down Expand Up @@ -84,7 +89,7 @@ final class SnapshotDownloadCommand extends Command<void> with Disposable {

Future<void> _download({required ISpin spinner, required Uri uri}) async {
final filename = uri.pathSegments.last;
final filepath = filename;
final filepath = joinAll([?argResults?.option("dir"), filename]);
final file = _file = .new(filepath);

final monitor = _monitor = .new();
Expand Down