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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! # cli-forge
//!
//! A unified command-line framework where argument parsing and styled output
//! speak one API. This release delivers the output layer every other piece — and
//! every sibling crate in the cli collection — is built on: one styling system,
//! reached three ways, over a single cross-platform terminal backend.
//!
//! ## The three styling paths
//!
//! Plain text is the common case and stays cheap — [`out`] and [`err`] do no
//! parsing and no allocation for a string literal:
//!
//! ```
//! use cli_forge::{out, err};
//!
//! out("building...");
//! err("something went wrong");
//! ```
//!
//! When you want color, opt into one of three paths that all render to the same
//! bytes for the same intent:
//!
//! ```
//! use cli_forge::{define_tag, out, parse, style, tag};
//!
//! // 1. The builder — chain methods, drop the result into `out`.
//! out(style("done").green().bold());
//!
//! // 2. Inline tags — markup parsed only here, never in `out`.
//! parse("<c=red><b>ERROR:</b></c> <c=#ff8800>disk almost full</c>");
//!
//! // 3. A named style — define once, reuse anywhere.
//! define_tag("error", style("").red().bold());
//! out(tag("error").render_with("build failed"));
//! ```
//!
//! ## Colors and terminals
//!
//! Colors are the eight standard names, plus any 24-bit value via
//! [`Style::hex`] / [`Style::rgb`] or a `<c=#rrggbb>` / `<c=r,g,b>` tag. The
//! terminal's capability is detected once: on a true-color terminal the exact
//! value is emitted; on a 256- or 16-color terminal it is downgraded to the
//! nearest representable color; on a pipe, under `NO_COLOR`, or with the `color`
//! feature off, styling is dropped and only text is written. The Windows console
//! is handled behind the same API as Unix terminals.
//!
//! ## Feature flags
//!
//! - **`std`** *(default)* — terminal detection and the stdout/stderr writers.
//! - **`color`** *(default)* — ANSI styled output. Disable for plain output; the
//! API stays complete and every styled value renders as its plain text.
//! - **`auth`** — reserved for the `requires_auth` command flag (v0.5.0); no
//! effect yet.
pub use crate;
pub use crate;
pub use crate;
pub use crateparse;