1use rootcause::report;
4use ytil_sys::pico_args::Arguments;
5
6mod fix;
7
8pub fn run(mut cli_args: Arguments) -> rootcause::Result<()> {
14 let command = cli_args.subcommand()?;
15 match command.as_deref() {
16 None => {
17 if cli_args.contains("--help") {
18 print!("{}", crate::cmds::Help::Repo.text());
19 return Ok(());
20 }
21 if cli_args.finish().is_empty() {
22 eprintln!("{}", crate::cmds::Help::Repo.text());
23 return Err(report!("missing frs repo command"));
24 }
25 Err(report!("missing repo subcommand"))
26 }
27 Some("fix") => fix::run(cli_args),
28 Some(command) => Err(report!("unsupported repo command").attach(format!("command={command}"))),
29 }
30}