git-walk 0.0.1

Read-only discovery of git repositories: walk a file tree and rank the checkouts it finds with cheap git metadata, without invoking git.
Documentation
//! Command-line entry point for `git-walk`.
//!
//! Repository discovery is not implemented yet; this binary currently only
//! answers `--version` and `--help`.

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
        }
    }
}