main.rs 485 B

1234567891011121314151617181920212223242526272829
  1. mod build_ebpf;
  2. use std::process::exit;
  3. use structopt::StructOpt;
  4. #[derive(StructOpt)]
  5. pub struct Options {
  6. #[structopt(subcommand)]
  7. command: Command,
  8. }
  9. #[derive(StructOpt)]
  10. enum Command {
  11. BuildEbpf(build_ebpf::Options),
  12. }
  13. fn main() {
  14. let opts = Options::from_args();
  15. use Command::*;
  16. let ret = match opts.command {
  17. BuildEbpf(opts) => build_ebpf::build(opts),
  18. };
  19. if let Err(e) = ret {
  20. eprintln!("{:#}", e);
  21. exit(1);
  22. }
  23. }