use std::collections::HashMap;
use std::path::PathBuf;
use thiserror::Error;
use crate::error::{ParseError, TemplateError};
#[derive(Error, Debug)]
pub enum CliTableError {
#[error("index parse error at line {line}: {message}")]
IndexParse { line: usize, message: String },
#[error("no matching template found for attributes: {0:?}")]
NoMatch(HashMap<String, String>),
#[error("template file not found: {0}")]
TemplateNotFound(PathBuf),
#[error("invalid completion syntax: {0}")]
InvalidCompletion(String),
#[error("invalid regex pattern at line {line}: {message}")]
InvalidRegex { line: usize, message: String },
#[error("missing required column '{0}' in index file")]
MissingColumn(String),
#[error(transparent)]
Template(#[from] TemplateError),
#[error(transparent)]
Parse(#[from] ParseError),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
}