frost-builtins 0.1.0

Built-in shell commands for frost
Documentation
//! The `set` builtin — set shell options and positional parameters.
//! Also `shift` — shift positional parameters.

use crate::{Builtin, ShellEnvironment};

pub struct Set;

impl Builtin for Set {
    fn name(&self) -> &str {
        "set"
    }

    fn execute(&self, _args: &[&str], _env: &mut dyn ShellEnvironment) -> i32 {
        // Minimal implementation: ignore options for now.
        // A full implementation would handle set -e, set -x, etc.
        0
    }
}

pub struct Shift;

impl Builtin for Shift {
    fn name(&self) -> &str {
        "shift"
    }

    fn execute(&self, _args: &[&str], _env: &mut dyn ShellEnvironment) -> i32 {
        // Shift needs access to positional params which isn't in the trait.
        // The executor handles this directly.
        0
    }
}