mod build_ebpf; mod build; mod run; mod codegen; use std::process::exit; use clap::Parser; use env_logger::Env; #[derive(Debug, Parser)] pub struct Options { #[clap(subcommand)] command: Command, } #[derive(Debug, Parser)] enum Command { BuildEbpf(build_ebpf::Options), BuildArtifacts(build::Options), Run(run::Options), CodeGen, } fn main() { env_logger::Builder::from_env(Env::default().default_filter_or("info")).init(); let opts = Options::parse(); use Command::*; let ret = match opts.command { BuildEbpf(opts) => build_ebpf::build_ebpf(opts), BuildArtifacts(opts) => build::build(opts), Run(opts) => run::run(opts), CodeGen => codegen::generate(), }; if let Err(e) = ret { eprintln!("{:#}", e); exit(1); } }