Expand description
CLI utilities for command-line applications.
This module provides common patterns for CLI applications including:
- Reading input from files, stdin, or command-line arguments
- Writing output to files or stdout
- Formatting and printing results with different output formats
- Error handling and exit codes
Enums§
- Output
Format - Output format for CLI results.
Functions§
- exit_if
- Exits the process with an error code if condition is true.
- print_
result - Prints a result, handling errors with proper formatting.
- print_
with_ format - Prints a value with the specified output format.
- read_
input - Reads input from a file, inline string, or stdin.
- read_
json - Reads and parses JSON from a file.
- write_
output - Writes content to a file or stdout.