diff --git a/Cargo.toml b/Cargo.toml index 669eaac..aeb5669 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ exclude = ["*.cpio.gz", "*.cpio", "vmlinux*", "test-*"] [dependencies] tokio = { version = "1", features = ["full"] } -clap = { version = "4", features = ["derive"] } oci-distribution = "0.11" tar = "0.4" flate2 = "1.0" @@ -25,13 +24,16 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -indicatif = "0.17" glob = "0.3" tempfile = "3" futures = "0.3" walkdir = "2" -ratatui = "0.30.0" -crossterm = "0.29.0" + +# CLI dependencies +clap = { version = "4", features = ["derive"], optional = true } +ratatui = { version = "0.30.0", optional = true } +crossterm = { version = "0.29.0", optional = true } +indicatif = { version = "0.17", optional = true } [dev-dependencies] tokio-test = "0.4" @@ -39,7 +41,12 @@ tokio-test = "0.4" [[bin]] name = "initramfs-builder" path = "src/main.rs" +required-features = ["cli"] [lib] name = "initramfs_builder" path = "src/lib.rs" + +[features] +default = [] +cli = ["clap", "ratatui", "crossterm", "indicatif"] diff --git a/README.md b/README.md index 71c768e..ac93f18 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ A Rusty CLI tool to convert Docker/OCI images into bootable initramfs for microV -## Installation +## CLI Installation ```bash -cargo install initramfs-builder +cargo install initramfs-builder --bin initramfs-builder -F cli ``` ## Quick Start