1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! snapdir CLI implementation library.
//!
//! Thin clap-derive front end for the `snapdir` orchestrator. `manifest` and
//! `id` are wired to `snapdir-core`'s in-process walk; the remaining
//! subcommands are wired to `snapdir-stores`/`snapdir-catalog`. Business
//! logic lives in the libraries — this crate only parses, dispatches, and
//! maps errors to exit codes.
//!
//! The shipped `snapdir` binary lives in the `snapdir` crate
//! (`crates/snapdir`), a shim whose `main` calls [`run`]. Two workspace
//! packages cannot both emit a `snapdir` bin (cargo warns "output filename
//! collision"), so the bin target moved there and this crate became the
//! implementation library. `snapdir-cli` versions <= 1.5 keep installing the
//! old binary.
//!
//! **Stability:** [`run`] is a *binary entrypoint*, not a stable library
//! API. It reads `std::env::args`, prints to stdout/stderr, and returns the
//! process exit code; no other items are exported and no semver guarantees
//! are made beyond "the `snapdir` binary keeps behaving as documented".
// Pure `snapdir diff` comparison logic (manifest map-diff + porcelain/JSON
// rendering); the store reads live in `cli`.
// The progress renderer engine, wired into every transfer command and gated by
// the --no-progress/--quiet/--color flags.
use ExitCode;
use Parser;
use crateCli;
/// Parses `std::env::args`, dispatches the subcommand, and maps the result
/// to the process exit code (success → 0, error → 1 after printing the
/// error chain to stderr).
///
/// This is the whole public surface: the `snapdir` binary's `main` is
/// `fn main() -> ExitCode { snapdir_cli::run() }`.