use crate::app::command::CompareCommand;
use crate::app::runtime_compare::{
    compare_candidate_table, compare_classic_profile, compare_post_special_conditions_scalars,
    compare_recipe_book_lines, compare_region_fixed_row_runs, compare_rt3_105_profile,
    compare_setup_launch_payload, compare_setup_payload_core,
};

pub(super) fn dispatch_compare(command: CompareCommand) -> Result<(), Box<dyn std::error::Error>> {
    match command {
        CompareCommand::CompareRegionFixedRowRuns {
            left_path,
            right_path,
        } => compare_region_fixed_row_runs(&left_path, &right_path),
        CompareCommand::CompareClassicProfile { smp_paths } => compare_classic_profile(&smp_paths),
        CompareCommand::CompareRt3105Profile { smp_paths } => compare_rt3_105_profile(&smp_paths),
        CompareCommand::CompareCandidateTable { smp_paths } => compare_candidate_table(&smp_paths),
        CompareCommand::CompareRecipeBookLines { smp_paths } => {
            compare_recipe_book_lines(&smp_paths)
        }
        CompareCommand::CompareSetupPayloadCore { smp_paths } => {
            compare_setup_payload_core(&smp_paths)
        }
        CompareCommand::CompareSetupLaunchPayload { smp_paths } => {
            compare_setup_launch_payload(&smp_paths)
        }
        CompareCommand::ComparePostSpecialConditionsScalars { smp_paths } => {
            compare_post_special_conditions_scalars(&smp_paths)
        }
    }
}
