xls-rs 0.1.2

A powerful CLI tool and library for spreadsheet manipulation with pandas-style operations. Supports CSV, Excel (XLSX, XLS, ODS), Parquet, and Avro formats with formula evaluation, data transformation, and comprehensive analytics capabilities.
Documentation
//! Advanced command handlers
//!
//! Implements advanced features like validation, charting, encryption, batch processing, etc.

use crate::cli::commands::advanced;
use anyhow::Result;

/// Advanced command handler
#[derive(Default)]
pub struct AdvancedCommandHandler;

impl AdvancedCommandHandler {
    /// Create a new advanced command handler
    pub fn new() -> Self {
        Self::default()
    }

    /// Handle the profile command
    pub fn handle_profile(&self, input: String, output: Option<String>) -> Result<()> {
        advanced::handle_profile(input, output)
    }

    /// Handle the schema command
    pub fn handle_schema(&self, input: String, output: Option<String>) -> Result<()> {
        advanced::handle_schema(input, output)
    }

    /// Handle the to-sql command
    pub fn handle_to_sql(
        &self,
        input: String,
        table: String,
        output: Option<String>,
        batch_size: Option<usize>,
    ) -> Result<()> {
        advanced::handle_to_sql(input, table, output, batch_size)
    }

    /// Handle the validate command
    pub fn handle_validate(
        &self,
        input: String,
        rules: String,
        output: Option<String>,
        report: Option<String>,
    ) -> Result<()> {
        advanced::handle_validate(input, rules, output, report)
    }

    /// Handle the chart command
    pub fn handle_chart(
        &self,
        input: String,
        output: String,
        chart_type: String,
        title: Option<String>,
        x_column: Option<String>,
        y_column: Option<String>,
    ) -> Result<()> {
        advanced::handle_chart(input, output, chart_type, title, x_column, y_column)
    }

    /// Handle the encrypt command
    pub fn handle_encrypt(
        &self,
        input: String,
        output: String,
        algorithm: String,
        key_file: Option<String>,
    ) -> Result<()> {
        advanced::handle_encrypt(input, output, algorithm, key_file)
    }

    /// Handle the decrypt command
    pub fn handle_decrypt(
        &self,
        input: String,
        output: String,
        key_file: Option<String>,
    ) -> Result<()> {
        advanced::handle_decrypt(input, output, key_file)
    }

    /// Handle the batch command
    pub fn handle_batch(
        &self,
        inputs: String,
        output_dir: String,
        operation: String,
        args: Vec<String>,
    ) -> Result<()> {
        advanced::handle_batch(inputs, output_dir, operation, args)
    }

    /// Handle the plugin command
    pub fn handle_plugin(
        &self,
        function: String,
        input: String,
        output: String,
        args: Vec<String>,
    ) -> Result<()> {
        advanced::handle_plugin(function, input, output, args)
    }

    /// Handle the stream command
    pub fn handle_stream(&self, input: String, output: String, chunk_size: usize) -> Result<()> {
        advanced::handle_stream(input, output, chunk_size)
    }

    /// Handle the completions command
    pub fn handle_completions(&self, shell: String) -> Result<()> {
        advanced::handle_completions(shell)
    }

    /// Handle the config_init command
    pub fn handle_config_init(&self) -> Result<()> {
        advanced::handle_config_init()
    }

    /// Handle the watch command
    pub fn handle_watch(&self, input: String, command: String) -> Result<()> {
        advanced::handle_watch(input, command)
    }

    /// Handle the export_styled command
    pub fn handle_export_styled(
        &self,
        input: String,
        output: String,
        style: Option<String>,
    ) -> Result<()> {
        advanced::handle_export_styled(input, output, style)
    }

    /// Handle the examples_generate command
    pub fn handle_examples_generate(&self) -> Result<()> {
        advanced::handle_examples_generate()
    }

    /// Handle the add_chart command
    pub fn handle_add_chart(
        &self,
        input: String,
        output: String,
        chart_type: String,
        title: Option<String>,
        category_column: Option<usize>,
        value_columns: Option<Vec<usize>>,
    ) -> Result<()> {
        advanced::handle_add_chart(input, output, chart_type, title, category_column, value_columns)
    }

    /// Handle the add_sparkline command
    pub fn handle_add_sparkline(
        &self,
        output: String,
        data_range: String,
        sparkline_cell: String,
        sheet: Option<String>,
    ) -> Result<()> {
        advanced::handle_add_sparkline(output, data_range, sparkline_cell, sheet)
    }

    /// Handle the conditional_format command
    pub fn handle_conditional_format(
        &self,
        output: String,
        range: String,
        condition: String,
        bg_color: Option<String>,
        font_color: Option<String>,
        bold: Option<bool>,
        sheet: Option<String>,
    ) -> Result<()> {
        advanced::handle_conditional_format(
            output,
            range,
            condition,
            bg_color,
            font_color,
            bold,
            sheet,
        )
    }

    /// Handle the apply_formula_range command
    pub fn handle_apply_formula_range(
        &self,
        input: String,
        output: String,
        formula: String,
        range: String,
        sheet: Option<String>,
    ) -> Result<()> {
        advanced::handle_apply_formula_range(input, output, formula, range, sheet)
    }
}