mirror of
https://github.com/danog/libdvb.git
synced 2024-11-30 04:19:00 +01:00
37 lines
541 B
Rust
37 lines
541 B
Rust
use {
|
|
std::{
|
|
path::Path,
|
|
},
|
|
|
|
anyhow::{
|
|
Context,
|
|
Result,
|
|
},
|
|
|
|
libdvb::{
|
|
CaDevice,
|
|
},
|
|
};
|
|
|
|
|
|
fn check_ca(path: &Path) -> Result<()> {
|
|
println!("CA: {}", path.display());
|
|
|
|
let ca = CaDevice::open(path, 0)?;
|
|
|
|
Ok(())
|
|
}
|
|
|
|
|
|
fn main() -> Result<()> {
|
|
let mut args = std::env::args().skip(1);
|
|
if let Some(path) = args.next() {
|
|
let path = Path::new(&path);
|
|
check_ca(&path)?;
|
|
} else {
|
|
eprintln!("path to ca device is not defined");
|
|
}
|
|
|
|
Ok(())
|
|
}
|