pub fn get_version(
language: &str,
file_path: impl AsRef<Path>,
) -> Result<String, VersionError>Expand description
Extracts the version number from package management files of different programming languages.
§Arguments
language- The programming language as a lowercase string (e.g., “python”, “typescript”)file_path- Path to the package management file
§Returns
Result<String, VersionError>- The version number if found, or an error
§Example
use pkg_version_parser::get_version;
match get_version("python", "path/to/pyproject.toml") {
Ok(version) => println!("Python project version: {}", version),
Err(e) => eprintln!("Error: {}", e),
}