24 lines
583 B
Rust
24 lines
583 B
Rust
// By Nic Weyand!
|
|
//! Open an externally pinned registry once and emit the complete lookup envelope.
|
|
|
|
use argand_site_registry::query::Registry;
|
|
use clap::Parser;
|
|
use std::path::PathBuf;
|
|
|
|
#[derive(Parser)]
|
|
struct Args {
|
|
#[arg(long)]
|
|
generation: PathBuf,
|
|
#[arg(long)]
|
|
pin: String,
|
|
#[arg(long)]
|
|
query: String,
|
|
}
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
let args = Args::parse();
|
|
let registry = Registry::open(&args.generation, &args.pin)?;
|
|
let result = registry.lookup(&args.query, 100)?;
|
|
println!("{}", serde_json::to_string(&result)?);
|
|
Ok(())
|
|
}
|