use std::process::ExitCode;
const HELP: &str = "\
git-walk -- read-only discovery of git repositories
Usage: git-walk [OPTIONS]
Options:
-h, --help Print help
-V, --version Print version
Repository discovery is not implemented yet (work in progress).
";
fn main() -> ExitCode {
match std::env::args().nth(1).as_deref() {
Some("-V" | "--version") => {
println!("git-walk {}", git_walk::version());
ExitCode::SUCCESS
}
None | Some("-h" | "--help") => {
print!("{HELP}");
ExitCode::SUCCESS
}
Some(arg) => {
eprintln!("git-walk: unexpected argument '{arg}'\n\n{HELP}");
ExitCode::FAILURE
}
}
}