Skip to main content

Module utils

Module utils 

Source
Expand description

Utility functions for KGet.

This module provides helper functions used throughout the library:

  • Console output management
  • URL filename extraction
  • Path resolution

§Example

use kget::get_filename_from_url_or_default;

let name = get_filename_from_url_or_default(
    "https://example.com/downloads/file.zip",
    "download"
);
assert_eq!(name, "file.zip");

Functions§

get_filename_from_url_or_default
Extract the filename from a URL or return a default.
print
Print a message to the console if not in quiet mode.
resolve_output_path
Resolve the final output path for a download.