bel7_cli/lib.rs
1// Copyright (C) 2025-2026 Michael S. Klishin and Contributors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Common CLI utilities for Rust command-line applications.
16//!
17//! This crate provides:
18//!
19//! - Colored console output helpers (success, error, warning, info)
20//! - String truncation for display
21//! - Table styling utilities (requires `tables` feature)
22//! - Clap argument helpers (requires `clap` feature)
23//! - Shell completion generation (requires `completions` feature)
24//! - Progress reporting (requires `progress` feature)
25//!
26//! # Features
27//!
28//! - `tables` - Enables table styling with `tabled`
29//! - `clap` - Enables clap argument helper extensions
30//! - `completions` - Enables shell completion generation
31//! - `progress` - Enables progress reporting utilities
32//! - `errors` - Enables exit code mapping with `sysexits`
33//! - `full` - Enables all features
34
35#[cfg(feature = "errors")]
36mod errors;
37
38mod output;
39mod truncate;
40
41#[cfg(feature = "tables")]
42mod tables;
43
44#[cfg(feature = "clap")]
45mod clap_ext;
46
47#[cfg(feature = "completions")]
48mod completions;
49
50#[cfg(feature = "progress")]
51mod progress;
52
53pub use output::*;
54pub use truncate::*;
55
56#[cfg(feature = "tables")]
57pub use tables::*;
58
59#[cfg(feature = "clap")]
60pub use clap_ext::*;
61
62#[cfg(feature = "completions")]
63pub use completions::*;
64
65#[cfg(feature = "progress")]
66pub use progress::*;
67
68#[cfg(feature = "errors")]
69pub use errors::*;
70
71mod testing;
72pub use testing::*;