nut-shell 0.1.1

A lightweight command-line interface library for embedded systems
Documentation
[workspace]
members = ["macros"]
exclude = ["examples/native", "examples/rp-pico", "examples/rp-pico-buildtime", "examples/stm32f072", "size-analysis/minimal"]
resolver = "2"

[package]
name = "nut-shell"
version = "0.1.1"
edition = "2024"
authors = ["Esben Dueholm Nørgaard"]
license = "MIT OR Apache-2.0"
description = "A lightweight command-line interface library for embedded systems"
repository = "https://github.com/HybridChild/nut-shell"
documentation = "https://docs.rs/nut-shell"
readme = "README.md"
keywords = ["embedded", "no-std", "cli", "shell", "command-line"]
categories = ["embedded", "no-std", "command-line-interface"]

[dependencies]
heapless = { version = "0.9.2", default-features = false }
nut-shell-macros = { version = "0.1.0" }

# Optional dependencies for specific features
sha2 = { version = "0.10", default-features = false, optional = true }
subtle = { version = "2.5", default-features = false, optional = true }

# Dependencies for credgen binary (std-only, not used in no_std library)
serde = { version = "1.0", features = ["derive"], optional = true }
toml = { version = "0.9.8", optional = true }
getrandom = { version = "0.4", optional = true }

[target.'cfg(not(target_os = "none"))'.dev-dependencies]
# For testing only (std available, not for embedded targets)
tokio = { version = "1.49.0", features = ["macros", "rt"] }

[[bin]]
name = "nut-shell-credgen"
path = "src/bin/credgen.rs"
required-features = ["authentication", "credgen"]

[features]
default = ["completion", "history"]

# Authentication feature - adds login/logout, password hashing, access control
authentication = ["dep:sha2", "dep:subtle"]

# Tab completion feature - enables command/path completion
completion = []

# Command history feature - enables up/down arrow navigation
history = []

# Async command support - enables async command execution
async = []

# Credential generator binary (std-only, requires authentication)
credgen = ["authentication", "dep:serde", "dep:toml", "dep:getrandom"]

[profile.release]
opt-level = "z"       # Optimize for size
lto = true            # Link-time optimization
codegen-units = 1     # Better optimization, slower compile
strip = true          # Strip symbols

[profile.dev]
opt-level = 1         # Some optimization for faster dev builds