pimalaya_cli/lib.rs
1#![cfg_attr(docsrs, feature(doc_cfg))]
2
3//! Shared building blocks for the Pimalaya command-line tools.
4//! Published for internal Pimalaya usage: the API follows the needs of
5//! its consumers (himalaya, neverest, cardamum, calendula and friends)
6//! and may change without notice. Third parties should treat it as
7//! private; the io-* protocol crates and pimalaya-stream are the
8//! supported surface.
9//!
10//! This crate factors out the pieces every Pimalaya CLI would
11//! otherwise reimplement: argument parsing glue, output rendering,
12//! logging, interactive prompts and the account setup wizards. Each
13//! piece sits behind its own cargo feature, so a binary pulls in only
14//! what it uses.
15//!
16//! Unlike the io-* protocol libraries this crate is deliberately std:
17//! it exists to talk to a terminal, a filesystem and a human, so it
18//! never targets no_std.
19//!
20//! The clap module wires shared arguments and the completion, manual
21//! and JSON Schema commands into a binary's parser. The printer and error
22//! modules render command output, events and failures to stdout, the
23//! output module holds the shapes every binary shares (bytes, pages),
24//! and the log module initializes the logger. The prompt, spinner and table
25//! modules handle interactive input and formatted output, and the
26//! validator module holds reusable value parsers. The wizard module
27//! collects account settings per protocol (IMAP, SMTP, JMAP, CalDAV,
28//! CardDAV), each protocol behind its matching feature. The build
29//! module exposes helpers for build scripts.
30
31#[cfg(feature = "build")]
32pub mod build;
33#[cfg(feature = "terminal")]
34pub mod clap;
35#[cfg(feature = "terminal")]
36pub mod error;
37#[cfg(feature = "terminal")]
38pub mod log;
39#[cfg(feature = "terminal")]
40pub mod output;
41#[cfg(feature = "terminal")]
42pub mod printer;
43#[cfg(feature = "prompt")]
44pub mod prompt;
45#[cfg(feature = "spinner")]
46pub mod spinner;
47#[cfg(feature = "table")]
48pub mod table;
49#[cfg(feature = "prompt")]
50pub mod validator;
51#[cfg(feature = "wizard")]
52pub mod wizard;