styled

Macro styled 

Source
macro_rules! styled {
    ($text:expr) => { ... };
    ($format:expr, $(($text:expr, $style:expr)),+ $(,)?) => { ... };
}
Expand description

Print styled text with symbol replacement and fine-grained control

This macro supports two modes:

  1. Symbol replacement: Use <symbol> tags that get replaced with styled symbols
  2. Fine-grained styling: Use {} placeholders with style tuples

§Symbol Replacement Examples

use supercli::styled;

// Simple symbol messages
styled!("<info> No files were updated");
styled!("<success> Operation completed successfully");
styled!("<warning> This action cannot be undone");
styled!("<error> Configuration file not found");

// Multiple symbols in one message
styled!(
    "Sync: <success> 42 updated, <info> 15 unchanged, <error> 2 failed"
);
styled!("Processing files... <info> Found 3 secrets <warning> 1 critical");

§Fine-Grained Styling Examples

use supercli::styled;

// Mixed styling with placeholders
styled!(
    "Processing {} files in {}",
    ("150", "number"),
    ("/home/user", "file_path")
);