Skip to main content

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//! fields module lays a text record out as aligned `Label: value` lines,
24//! the output module holds the shapes every binary shares (bytes, pages),
25//! and the log module initializes the logger. The prompt, spinner and table
26//! modules handle interactive input and formatted output, and the
27//! validator module holds reusable value parsers. The wizard module
28//! collects account settings per protocol (IMAP, SMTP, JMAP, CalDAV,
29//! CardDAV), each protocol behind its matching feature. The build
30//! module exposes helpers for build scripts.
31
32#[cfg(feature = "build")]
33pub mod build;
34#[cfg(feature = "terminal")]
35pub mod clap;
36#[cfg(feature = "terminal")]
37pub mod error;
38#[cfg(feature = "terminal")]
39pub mod fields;
40#[cfg(feature = "terminal")]
41pub mod log;
42#[cfg(feature = "terminal")]
43pub mod output;
44#[cfg(feature = "terminal")]
45pub mod printer;
46#[cfg(feature = "prompt")]
47pub mod prompt;
48#[cfg(feature = "spinner")]
49pub mod spinner;
50#[cfg(feature = "table")]
51pub mod table;
52#[cfg(feature = "prompt")]
53pub mod validator;
54#[cfg(feature = "wizard")]
55pub mod wizard;