Skip to content

Commit 278c989

Browse files
add stub cli exes
1 parent 2cd3089 commit 278c989

File tree

5 files changed

+142
-0
lines changed

5 files changed

+142
-0
lines changed

cli/Cargo.toml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[package]
2+
name = "zip-cli"
3+
version = "0.0.1"
4+
authors = [
5+
"Danny McClanahan <[email protected]>",
6+
]
7+
license = "MIT"
8+
repository = "https://github.com/zip-rs/zip2.git"
9+
keywords = ["zip", "archive", "compression", "cli"]
10+
categories = ["command-line-utilities", "compression", "filesystem", "development-tools::build-utils"]
11+
# This field is not as important as in the top-level library API, but as there:
12+
# Any change to rust-version must be reflected also in `README.md` and `.github/workflows/ci.yaml`.
13+
# The MSRV policy is documented in `README.md`.
14+
rust-version = "1.85.0"
15+
description = """
16+
Binary for creation and manipulation of zip files.
17+
18+
This package can enable or disable certain dependencies during the build and install process with
19+
cargo features.
20+
"""
21+
edition = "2024"
22+
23+
# Prevent this from interfering with workspaces
24+
[workspace]
25+
members = ["."]
26+
27+
[lib]
28+
29+
[[bin]]
30+
name = "zip-cli"
31+
32+
[dependencies.zip]
33+
path = ".."
34+
default-features = false
35+
36+
[features]
37+
aes-crypto = ["zip/aes-crypto"]
38+
bzip2 = ["zip/bzip2"]
39+
chrono = ["zip/chrono"]
40+
deflate64 = ["zip/deflate64"]
41+
deflate = ["zip/deflate"]
42+
deflate-flate2 = ["zip/deflate-flate2"]
43+
deflate-flate2-zlib-rs = ["zip/deflate-flate2-zlib-rs"]
44+
deflate-flate2-zlib = ["zip/deflate-flate2-zlib"]
45+
deflate-zopfli = ["zip/deflate-zopfli"]
46+
lzma = ["zip/lzma"]
47+
ppmd = ["zip/ppmd"]
48+
time = ["zip/time"]
49+
xz = ["zip/xz"]
50+
zstd = ["zip/zstd"]
51+
52+
default = [
53+
"aes-crypto",
54+
"bzip2",
55+
"deflate64",
56+
"deflate",
57+
"lzma",
58+
"ppmd",
59+
"time",
60+
"xz",
61+
"zstd",
62+
]
63+
64+
[profile.release]
65+
strip = true
66+
lto = true
67+
opt-level = 3
68+
codegen-units = 1

cli/clite/Cargo.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[package]
2+
name = "zip-clite"
3+
version = "0.0.1"
4+
authors = [
5+
"Danny McClanahan <[email protected]>",
6+
]
7+
license = "MIT"
8+
repository = "https://github.com/zip-rs/zip2.git"
9+
keywords = ["zip", "archive", "compression", "cli"]
10+
categories = ["command-line-utilities", "compression", "filesystem", "development-tools::build-utils"]
11+
# This field is not as important as in the top-level library API, but as there:
12+
# Any change to rust-version must be reflected also in `README.md` and `.github/workflows/ci.yaml`.
13+
# The MSRV policy is documented in `README.md`.
14+
rust-version = "1.85.0"
15+
description = """
16+
Binary for creation and manipulation of zip files.
17+
18+
This distribution is created to be intentionally very small and easy to audit. It has reduced
19+
functionality, builds to optimize for size, and only bundles in support for a Rust
20+
DEFLATE implementation.
21+
"""
22+
edition = "2024"
23+
24+
# Prevent this from interfering with workspaces
25+
[workspace]
26+
members = ["."]
27+
28+
[[bin]]
29+
name = "zip-clite"
30+
31+
# NB: This is not a dependency on the top-level `zip` crate, but the `zip-cli` crate (which mirrors
32+
# the declared features from `zip`). We do not use its `main.rs` entry point, but rely upon
33+
# `lib.rs`, which was specifically designed to minimize the amount of code specific to
34+
# `zip-clite`.
35+
[dependencies.zip-cli]
36+
path = ".."
37+
default-features = false
38+
features = [
39+
"deflate-flate2",
40+
"deflate-flate2-zlib-rs",
41+
]
42+
43+
# No features, no options, no decisions! We're just making it explicit.
44+
[features]
45+
default = []
46+
47+
[profile.release]
48+
strip = true
49+
lto = true
50+
opt-level = "s"
51+
codegen-units = 1

cli/clite/src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use zip_cli::shared_main;
2+
3+
fn main() {
4+
shared_main()
5+
}

cli/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//! Shared entry point for `zip-cli` and `zip-clite`.
2+
//!
3+
//! The difference between the two distributions should be a matter of their selected features and
4+
//! optimization flags, and nothing more. If the two retain a 100% compatible CLI API, users will be
5+
//! able to select the distribution purely based upon the functionality/security they need for that
6+
//! particular use case.
7+
8+
use std::process;
9+
10+
pub fn shared_main() -> ! {
11+
eprintln!("here!");
12+
process::exit(0)
13+
}

cli/src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use zip_cli::shared_main;
2+
3+
fn main() {
4+
shared_main()
5+
}

0 commit comments

Comments
 (0)