Module command_utils

Module command_utils 

Source
Expand description

Utility functions shared across CLI commands.

This module provides common helper functions used by various CLI commands, including formatting, validation, and retry logic.

Functionsยง

calculate_percentage
Calculate percentage safely (handles division by zero).
display_log_line
Display a log line with optional level filtering.
format_bytes
Format byte size into human-readable string.
format_count
Format a count with thousands separators.
format_duration
Format duration into human-readable string.
format_relative_time
Format a timestamp into a human-readable relative time.
format_task_stats_csv
Format task statistics as CSV rows
mask_password
Mask password in connection URLs for safe display.
print_progress
Display a simple progress indicator.
print_task_details
Print task details in a formatted table.
retry_with_backoff
Retry an async operation with exponential backoff.
send_webhook_alert
Send alert via webhook.
truncate_string
Truncate a string to a maximum length with ellipsis.
validate_broker_url
Validate and normalize broker URL.
validate_queue_name
Validate queue name.
validate_task_id
Validate task ID format (UUID).
write_csv
Write data to CSV file