rustflow_cli 0.19.0

RustFlow command line interface: collect, generate and export NetFlow, IPFIX and sFlow
use anyhow::Result;
use clap::{Parser, Subcommand};
use rustflow_collect::CollectArgs;
use rustflow_generate::GenerateArgs;

#[derive(Parser)]
#[command(name = "rustflow", version)]
#[command(about = "High-performance NetFlow, IPFIX and sFlow tooling")]
struct Cli {
    #[command(subcommand)]
    command: Command,
}

#[derive(Subcommand)]
enum Command {
    /// Collect flows from the network or a pcap file and write them out
    Collect(Box<CollectArgs>),

    /// Generate synthetic IPFIX traffic for testing a collector
    Generate(Box<GenerateArgs>),

    /// Capture packets on an interface and export them as IPFIX
    Export(Box<rustflow_export::ExportArgs>),
}

fn main() -> Result<()> {
    env_logger::init();

    match Cli::parse().command {
        Command::Collect(args) => rustflow_collect::run(*args),
        Command::Generate(args) => rustflow_generate::run(*args),
        Command::Export(args) => rustflow_export::run(*args),
    }
}