()
| 18 | install-pre-commit-hook Install git pre-commit hook that formats code with `cargo fmt`"; |
| 19 | |
| 20 | fn main() -> Result<()> { |
| 21 | simple_logger::SimpleLogger::new().init().unwrap(); |
| 22 | |
| 23 | if let Some(true) = env::args().next().map(|it| it.contains("pre-commit")) { |
| 24 | return pre_commit::run_hook(); |
| 25 | } |
| 26 | |
| 27 | let mut args = pico_args::Arguments::from_env(); |
| 28 | |
| 29 | match args.subcommand()?.unwrap_or_default().as_str() { |
| 30 | "install-pre-commit-hook" => { |
| 31 | args.finish()?; |
| 32 | pre_commit::install_hook()?; |
| 33 | eprintln!("Git pre-commit hook is successfully installed. Have a nice day :D"); |
| 34 | } |
| 35 | _ => eprintln!("{}", HELP), |
| 36 | } |
| 37 | Ok(()) |
| 38 | } |
nothing calls this directly
no test coverage detected