Crate cli_fmt

Crate cli_fmt 

Source
Expand description

CLI output formatting utilities.

This crate provides utilities for building command-line applications, including output processing, formatting, and other CLI-specific helpers.

§Modules

  • output - Process command output (head/tail filtering, width truncation, stream merging)

§Architecture

This crate focuses on CLI-application-specific functionality. For general-purpose string and ANSI manipulation, use strs_tools instead.

Distinction:

  • strs_tools: Generic string/ANSI utilities (any application)
  • cli_fmt: CLI-specific helpers (command-line tools only)

§Examples

use cli_fmt::output::*;

let config = OutputConfig::default()
  .with_head( 10 )
  .with_width( 80 );

let result = process_output( "stdout text", "stderr text", &config );
println!( "{}", result.content );

Modules§

dependency
Namespace with dependencies.
exposed
Exposed namespace of the module.
orphan
Orphan namespace of the module.
output
CLI output processing. CLI output processing utilities
own
Own namespace of the module.
prelude
Prelude to use essentials: use cli_fmt::prelude::*.