use crate::cli::*;
use crate::codes::nr5g::{BaseGraph, LiftingSize};
use clap::Parser;
#[derive(Debug, Parser)]
pub struct Args {
#[arg(long)]
pub base_graph: BaseGraph,
#[arg(long)]
pub lifting_size: LiftingSize,
#[arg(long)]
pub girth: bool,
}
impl Run for Args {
fn run(&self) -> std::result::Result<(), Box<dyn std::error::Error>> {
let h = self.base_graph.h(self.lifting_size);
if self.girth {
if let Some(g) = h.girth() {
println!("Code girth = {}", g);
} else {
println!("Code girth is infinite");
}
} else {
println!("{}", h.alist());
}
Ok(())
}
}