stuffr-cli 0.12.0

The stuffr command line interface
Documentation
[package]
name = "stuffr-cli"
version.workspace = true
description = "The stuffr command line interface"
edition.workspace = true
rust-version.workspace = true
# Not the workspace's MIT alone: `compat` ports code from bzip2.c and
# bzip2recover.c, whose licence ships as LICENSE-bzip2, and from Apple's
# (FreeBSD's, NetBSD's) gzip.c and its decoders, whose notices ship as
# LICENSE-gzip-bsd: BSD-2-Clause for all but zuncompress.c (the Regents
# of the University of California's BSD-3-Clause), which the `.Z` reader
# ports. SPDX deprecated `BSD-2-Clause-NetBSD` and `-FreeBSD` for
# `BSD-2-Clause`, whose text they share.
# One caveat: the Lzd notice in unlz.c is BSD-style but not word for word the
# SPDX BSD-2-Clause text; the full notice ships in LICENSE-gzip-bsd.
license = "MIT AND bzip2-1.0.6 AND BSD-2-Clause AND BSD-3-Clause"
repository.workspace = true
keywords = ["compression", "archive", "cli", "unzip", "extract"]
categories = ["command-line-utilities", "compression"]
readme = "README.md"

[[bin]]
name = "stuffr"
path = "src/main.rs"

# Passthroughs to the facade, and they exist for one reason: `cargo install
# stuffr-cli --features <x>` is what the documentation tells a user to type,
# and Cargo resolves `<x>` against THIS package, not against its dependency.
# Until Phase 3b's fix wave there was no `[features]` section here at all, so
# every documented install command failed with "the package 'stuffr-cli' does
# not contain this feature" — `--features c-backed` had shipped that way since
# before `legacy` existed, printed as a copyable line in both READMEs. The only
# working spelling was `--features stuffr/legacy`, which appeared nowhere.
#
# One entry per name any document tells a user to install with: the two build
# tiers, the `legacy` bundle, `full`, and the three legacy formats the README
# names individually. `cargo install stuffr-cli` on its own still gets the
# facade's own `default = ["pure"]` — nothing here is a default, so adding a
# feature never silently changes what a plain install builds.
# `documented_install_commands_name_features_this_crate_declares` in
# `tests/cli.rs` fails the build if a README grows a `--features` spelling this
# table does not carry.
[features]
pure = ["stuffr/pure"]
# `zlib-c` is a passthrough so this crate's own `cfg(feature = "zlib-c")` and
# its integration tests can see it; `c-backed` implies it, and `full` names
# `c-backed` itself — `stuffr/full` alone would turn on stuffr's `zlib-c` but
# not this crate's, and the byte suite would silently run the compatible tier.
c-backed = ["stuffr/c-backed", "zlib-c", "xz-c"]
zlib-c = ["stuffr/zlib-c"]
# The Apple gzip personality's `unxz` runs over liblzma itself on the C
# tier (`stuffr::xz_stream`), as Apple's does; elsewhere over the
# registry's xz decoder.
xz-c = ["stuffr/xz-c"]
legacy = ["stuffr/legacy"]
full = ["stuffr/full", "c-backed"]
lha = ["stuffr/lha"]
arj = ["stuffr/arj"]
compress = ["stuffr/compress"]
arc = ["stuffr/arc"]
zoo = ["stuffr/zoo"]

# Note the absence of `default-features = false` here: this edge always
# requests `stuffr`'s own `default` feature set (`pure` and, since the commit
# that added `legacy` to it, `legacy` too) regardless of any
# `--no-default-features`/`--features` passed to `stuffr-cli` itself —
# `stuffr-cli` declares no `[features] default` of its own for that flag to
# disable. Verified directly: `cargo build -p stuffr-cli
# --no-default-features` (no `--features` at all) still ships `lha`, `arj`
# and `compress` in `stuffr formats`. Consequence: there is no CLI-flag-only
# way to build the `stuffr` binary without `legacy` any more — see the dead
# projection this made in `crates/stuffr-cli/tests/cli.rs`.
[dependencies]
stuffr = { path = "../stuffr", version = "0.12.0", features = ["serde"] }
clap = { workspace = true }
serde_json = "1"
# The gzip compatibility family's member layer: raw deflate/inflate and CRC32.
# Already in every build's graph through stuffr-formats; the backend is never
# changed here (no zlib/zlib-ng/zlib-rs feature anywhere).
flate2 = { workspace = true }

# The bzip2 compatibility mode restores `SIGPIPE`'s default action, so a
# closed pipe ends it the way it ends bzip2. Already in the lock (a
# transitive dependency, and this crate's own unix dev-dependency).
[target.'cfg(unix)'.dependencies]
libc = "0.2"

[dev-dependencies]
# The same facade with `testing` on, for `stuffr::testing::COMPAT_NAMES`: a
# unit test holds the fuzz target's name table to `compat::names()`.
stuffr = { path = "../stuffr", features = ["testing"] }
# Fixture builders for the `list`/`test` integration tests: real tar and
# real gzip, independent of `stuffr-formats`' own `Tar`/gzip implementations,
# so a read-side bug there cannot also hide in the fixture that exercises it.
tar = { workspace = true }

# `compat_harness` opens a pseudo-terminal with `openpty` so a differential
# case can make stdin or stdout a tty. `libc` is already in the lock (a
# transitive dependency), so this adds a manifest edge, not a new crate.
[target.'cfg(unix)'.dev-dependencies]
libc = "0.2"