pub async fn cli(
minor_contracts_links: &BTreeMap<String, String>,
public_tenders_links: &BTreeMap<String, String>,
) -> AppResult<()>Expand description
Parses command-line arguments and executes the download command.
This function handles two subcommands:
cli: Manual CLI with default configuration (cleanup always enabled)toml: Run using a TOML configuration file (cleanup configurable)
Both subcommands execute the same workflow for downloading and processing procurement data:
- Parses CLI arguments (procurement type, period range, cleanup options)
- Filters available links by the specified period range
- Downloads ZIP files from the filtered URLs
- Extracts ZIP archives to access XML/Atom files
- Parses XML/Atom content and converts to Parquet format
- Performs cleanup if requested
§Arguments
minor_contracts_links- Map of period strings (e.g., “202301”) to minor contracts download URLspublic_tenders_links- Map of period strings (e.g., “202301”) to public tenders download URLs
§Returns
Returns Ok(()) if all operations complete successfully. Returns an error if:
- Invalid period ranges are specified
- Network requests fail
- File I/O operations fail
- XML parsing fails