pub fn inspect(file: &str, verbose: bool) -> Result<(), CliError>Expand description
Inspect and visualize the internal structure of a HEDL file.
Parses a HEDL file and displays its internal structure in a human-readable, tree-like format with color highlighting. Useful for debugging and understanding HEDL document organization.
§Arguments
file- Path to the HEDL file to inspectverbose- Iftrue, shows detailed field values and schema information
§Returns
Returns Ok(()) on success.
§Errors
Returns Err if:
- The file cannot be read
- The file contains syntax errors
§Examples
use hedl_cli::commands::inspect;
// Inspect with basic output
inspect("example.hedl", false)?;
// Inspect with verbose details (shows all fields and schemas)
inspect("example.hedl", true)?;§Output
Displays:
- HEDL version
- Struct definitions (type names and columns)
- Alias definitions
- Nest relationships (parent > child)
- Root document structure (tree view)
- In verbose mode: field values, schemas, and row details