Skip to content

Commit 5c86d03

Browse files
authored
Merge pull request #1708 from kabilar/download
Document options for the `dandi download --existing` flag
2 parents 2827711 + 4883dd5 commit 5c86d03

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

dandi/cli/cmd_download.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,14 @@
6464
"--existing",
6565
type=click.Choice(list(DownloadExisting)),
6666
# TODO: verify-reupload (to become default)
67-
help="What to do if a file found existing locally. 'refresh': verify "
68-
"that according to the size and mtime, it is the same file, if not - "
69-
"download and overwrite.",
67+
help="How to handle paths that already exist locally. "
68+
"For 'error', if the local file exists, display an error and skip downloading that asset. "
69+
"For 'skip', if the local file exists, skip downloading that asset. "
70+
"For 'overwrite', if the local file exists, overwrite that asset. "
71+
"For 'overwrite-different', if the local file's hash is the same as on the server, the asset "
72+
"is skipped; otherwise, it is redownloaded. "
73+
"For 'refresh', if the local file's size and mtime are the same as on the server, the asset "
74+
"is skipped; otherwise, it is redownloaded.",
7075
default="error",
7176
show_default=True,
7277
)

docs/source/cmdline/download.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ Options
2020

2121
How to handle paths that already exist locally [default: ``error``]
2222

23+
For ``error``, if the local file exists, display an error and skip downloading that asset.
24+
25+
For ``skip``, if the local file exists, skip downloading that asset.
26+
27+
For ``overwrite``, if the local file exists, overwrite that asset.
28+
29+
For ``overwrite-different``, if the local file's hash is the same as on the
30+
server, the asset is skipped; otherwise, it is redownloaded.
31+
2332
For ``refresh``, if the local file's size and mtime are the same as on the
2433
server, the asset is skipped; otherwise, it is redownloaded.
2534

0 commit comments

Comments
 (0)