xref: /aosp_15_r20/external/bazelbuild-rules_rust/crate_universe/src/main.rs (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1*d4726bddSHONG Yifan //! The `cargo->bazel` binary's entrypoint
2*d4726bddSHONG Yifan 
3*d4726bddSHONG Yifan use cargo_bazel::cli;
4*d4726bddSHONG Yifan 
main() -> cli::Result<()>5*d4726bddSHONG Yifan fn main() -> cli::Result<()> {
6*d4726bddSHONG Yifan     // Parse arguments
7*d4726bddSHONG Yifan     let opt = cli::parse_args();
8*d4726bddSHONG Yifan 
9*d4726bddSHONG Yifan     match opt {
10*d4726bddSHONG Yifan         cli::Options::Generate(opt) => {
11*d4726bddSHONG Yifan             cli::init_logging("Generate");
12*d4726bddSHONG Yifan             cli::generate(opt)
13*d4726bddSHONG Yifan         }
14*d4726bddSHONG Yifan         cli::Options::Splice(opt) => {
15*d4726bddSHONG Yifan             cli::init_logging("Splice");
16*d4726bddSHONG Yifan             cli::splice(opt)
17*d4726bddSHONG Yifan         }
18*d4726bddSHONG Yifan         cli::Options::Query(opt) => {
19*d4726bddSHONG Yifan             cli::init_logging("Query");
20*d4726bddSHONG Yifan             cli::query(opt)
21*d4726bddSHONG Yifan         }
22*d4726bddSHONG Yifan         cli::Options::Vendor(opt) => {
23*d4726bddSHONG Yifan             cli::init_logging("Vendor");
24*d4726bddSHONG Yifan             cli::vendor(opt)
25*d4726bddSHONG Yifan         }
26*d4726bddSHONG Yifan     }
27*d4726bddSHONG Yifan }
28