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§
- auto_
extract - Extract an archive at
pathinto its parent directory using the system tool (unzip,tar, or7z). ReturnsOk(())if the path is not a recognised archive type (no-op) or if extraction succeeds. - get_
filename_ from_ url_ or_ default - Extract the filename from a URL or return a default.
- is_
extractable - Returns
truewhen the path’s extension is a supported archive format. - Print a message to the console if not in quiet mode.
- resolve_
output_ path - Resolve the final output path for a download.