use crate::signal::SignalKind;

#[derive(Debug, Clone)]
pub struct ClassifiedCommand {
    pub program: String,
    pub args: Vec<String>,
    pub kind: SignalKind,
    pub subcommand: Option<String>,
    pub is_pipeline: bool,
}

impl ClassifiedCommand {
    pub fn classify(program: impl Into<String>, args: Vec<String>) -> Self {
        let program = program.into();
        let kind = SignalKind::from_program(&program, &args);
        let subcommand = args.first().cloned();
        Self {
            program,
            args,
            kind,
            subcommand,
            is_pipeline: false,
        }
    }
}
