Page MenuHomeDevCentral

main.rs
No OneTemporary

use clap::Parser;
use crate::rfc_index::get_rfc_index;
use crate::rfc_parser::Rfc;
mod rfc_index;
mod rfc_parser;
#[derive(Debug, Parser)]
#[command(name = "rfc-datasource")]
#[clap(author="Nasqueron project", version, about="Download and print RFC index", long_about=None)]
pub struct RfcArgs {
/// The format string to use
#[arg(long, short = 'f')]
format: String,
/// The path to the RFC index source
#[arg(long, short = 's')]
source: Option<String>,
}
#[tokio::main]
async fn main() {
let args = RfcArgs::parse(); // Will exit if argument is missing or --help/--version provided.
let document = get_rfc_index(args.source).await
.expect("Can't read or fetch RFC index");
for rfc in Rfc::parse_document(&document) {
println!("{}", rfc.format(&args.format));
}
}

File Metadata

Mime Type
text/x-c
Expires
Mon, Nov 17, 16:05 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3174079
Default Alt Text
main.rs (827 B)

Event Timeline