You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
549 B
Rust
34 lines
549 B
Rust
mod build_ebpf;
|
|
mod run;
|
|
|
|
use std::process::exit;
|
|
|
|
use clap::Parser;
|
|
|
|
#[derive(Debug, Parser)]
|
|
pub struct Options {
|
|
#[clap(subcommand)]
|
|
command: Command,
|
|
}
|
|
|
|
#[derive(Debug, Parser)]
|
|
enum Command {
|
|
BuildEbpf(build_ebpf::Options),
|
|
Run(run::Options),
|
|
}
|
|
|
|
fn main() {
|
|
let opts = Options::parse();
|
|
|
|
use Command::*;
|
|
let ret = match opts.command {
|
|
BuildEbpf(opts) => build_ebpf::build_ebpf(opts),
|
|
Run(opts) => run::run(opts),
|
|
};
|
|
|
|
if let Err(e) = ret {
|
|
eprintln!("{e:#}");
|
|
exit(1);
|
|
}
|
|
}
|