diff options
Diffstat (limited to 'fatcat-cli/src/main.rs')
-rw-r--r-- | fatcat-cli/src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fatcat-cli/src/main.rs b/fatcat-cli/src/main.rs index ced35b4..3b96cce 100644 --- a/fatcat-cli/src/main.rs +++ b/fatcat-cli/src/main.rs @@ -485,6 +485,12 @@ fn run(opt: Opt) -> Result<()> { return Err(anyhow!("output directory doesn't exist")); } } + if jobs == 0 { + return Err(anyhow!("--jobs=0 not implemented")); + } + if jobs > 12 { + return Err(anyhow!("please don't download more than 12 parallel requests")); + } download_batch(input_path, output_dir, limit, jobs)?; } Command::Download { @@ -515,7 +521,7 @@ fn run(opt: Opt) -> Result<()> { resp => Err(anyhow!("{:?}", resp)) .with_context(|| format!("API GET failed: {:?}", ident)), }?; - download_release(&release_entity, output_path) + download_release(&release_entity, output_path, true) } Specifier::File(ident) => { let result = api_client.rt.block_on(api_client.api.get_file( @@ -528,7 +534,7 @@ fn run(opt: Opt) -> Result<()> { resp => Err(anyhow!("{:?}", resp)) .with_context(|| format!("API GET failed: {:?}", ident)), }?; - download_file(&file_entity, &file_entity.specifier(), output_path) + download_file(&file_entity, &file_entity.specifier(), output_path, true) } other => Err(anyhow!("Don't know how to download: {:?}", other)), }?; |