1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! Declarative input collection for CLI applications.
//!
//! `standout-input` provides a unified way to acquire user input from multiple
//! sources—CLI arguments, stdin, environment variables, editors, and interactive
//! prompts—with automatic fallback chains.
//!
//! # Quick Start
//!
//! ```ignore
//! use standout_input::{InputChain, ArgSource, StdinSource, DefaultSource};
//!
//! // Try argument first, then piped stdin, then default
//! let message = InputChain::<String>::new()
//! .try_source(ArgSource::new("message"))
//! .try_source(StdinSource::new())
//! .default("default message".to_string())
//! .resolve(&matches)?;
//! ```
//!
//! # Features
//!
//! - **`editor`** (default) - Enable [`EditorCollector`] for editor-based input
//! - **`simple-prompts`** (default) - Enable basic terminal prompts
//! - **`inquire`** - Enable rich TUI prompts via the inquire crate
//!
//! # Architecture
//!
//! The crate is built around the [`InputCollector`] trait, which all input
//! sources implement. Sources are composed into [`InputChain`]s that try each
//! source in order until one provides input.
//!
//! ```text
//! InputChain
//! ├── ArgSource → None (not provided)
//! ├── StdinSource → None (not piped)
//! ├── EditorSource → Some("user input") ← returns this
//! └── DefaultSource → (not reached)
//! ```
//!
//! # Testing
//!
//! All sources accept mock implementations for testing:
//!
//! ```
//! use standout_input::{StdinSource, env::MockStdin};
//!
//! // Test with simulated piped input
//! let source = StdinSource::with_reader(MockStdin::piped("test input"));
//! ```
// Re-export core types
pub use InputChain;
pub use ;
pub use InputError;
// Re-export sources at crate root for convenience
pub use ;
pub use ;
pub use ;
pub use ;
// Re-export mock types for testing
pub use ;