excel_cli/actions/
command.rs

1use super::types::{ActionCommand, ActionType};
2
3impl ActionCommand {
4    // Returns the action type of this command
5    #[must_use]
6    pub fn get_action_type(&self) -> ActionType {
7        match self {
8            ActionCommand::Cell(action) => match action.action_type {
9                ActionType::Paste => ActionType::Paste,
10                _ => ActionType::Edit, // Default case including Edit and Cut
11            },
12            ActionCommand::Row(_) => ActionType::DeleteRow,
13            ActionCommand::MultiRow(_) => ActionType::DeleteMultiRows,
14            ActionCommand::Column(_) => ActionType::DeleteColumn,
15            ActionCommand::MultiColumn(_) => ActionType::DeleteMultiColumns,
16            ActionCommand::Sheet(_) => ActionType::DeleteSheet,
17        }
18    }
19}