Skip to content

v0.8.1

Latest

Choose a tag to compare

@github-actions github-actions released this 30 May 09:19
v0.8.1
6d598e3

What's Changed

  • Allow passing custom chunk size to download files through config by @ghimiresdp in #29
  • Move CLI and progress indicators on its own feature by @ghimiresdp in #28
  • Added docs for Architecture Decision Records.

This release will eventually add more features to furl-cli since this release also includes furl core to accept configuration files.

Notable changes:

While using cli

while using cli, we can now pass -C or --chunksize to define the maximum size of each chunk to download.

cargo run -- https://github.com/ghimiresdp/furl-cli/releases/download/v0.7.0/furl-v0.7.0-linux-x86_64.tar.gz -c 1 -t2

While using library

  • while using library, we can now pass configurations as well as Progress Reporter.
  • developers now have flexibility to disable default features so that their dependency tree remains clean.

Warning

BREAKING CHANGE: while using furl-cli as a library mode, you need to explicitely pass the graphical progress reporter from furl_core:: GraphicalProgressReporter to be able to see the progress bar.

Regular Usage

please check examples for more usecase.

use furl_core::{Downloader, GraphicalProgressReporter};

#[tokio::main]
async fn main() {
        // use config
        let download_config =
            DownloadConfig::new().set_max_chunk_size(5 * 1024 * 1024); // 5 MB

    let url = "https://raw.githubusercontent.com/ghimiresdp/furl-cli/refs/heads/main/res/images/example.png";

    let mut downloader = Downloader::new(url)
        .with_reporter(GraphicalProgressReporter::new())
        .with_config(download_config);

    if downloader.download(".", None, Some(4)).await.is_ok() {
        println!("Download completed successfully!");
    } else {
        println!("Download failed.");
    }
}

No Visual Feedback

If you do not want any visual feedback, you can now stripe your dependency tree by adding the following in your Cargo.toml file.
This will not include clap and indicatif since we do not require both packages for our core library to run.

[dependencies]
furl-cli = { version="0.8.0", default-features = false }
use furl_core::Downloader;

#[tokio::main]
async fn main() {
    let url = "https://raw.githubusercontent.com/ghimiresdp/furl-cli/refs/heads/main/res/images/example.png";
    let mut downloader = Downloader::new(url);
    if downloader.download(".", None, Some(4)).await.is_ok() {
        println!("Download completed successfully!");
    } else {
        println!("Download failed.");
    }
}

Full Changelog: v0.7.0...v0.8.1