clamd-client

example in src/main.rs

```rust extern crate clamd_client;

use anyhow::Result; use std::env;

fn main() -> Result<()> { let args = env::args().collect::>(); let mut clamd = clamdclient::Clamd::new()?; match args.len() { 2 => { println!( "{}", match &args[1].tolowercase()[..] { "ping" => clamd.ping()?, "version" => clamd.version()?, "reload" => clamd.reload()?, "shutdown" => { clamd.shutdown()?; String::from("Shutdown succeeded") } other => format!("Command not found: {other}"), } ); } 3 => { println!( "{}", match &args[1].tolowercase()[..] { "scan" => clamd.scan(&args[2])?, "instream" => clamd.instreamscan(&args[2], None)?, other => format!("Command not found: {other}"), } ); } _ => { println!("Usage: {} [ping|version|reload|shutdown|scan|instream] [file]", args[0]) } }

Ok(())

} ```