Skip to main content

execute_command

Function execute_command 

Source
pub fn execute_command(
    command: &str,
    args: &[&str],
    options: &CommandOptions,
) -> DeviceResult<CommandOutput>
Expand description

Execute a command with the provided CommandOptions.

  • Validates command and arguments for security
  • If options.timeout is Some, uses run_command_with_timeout with that duration
  • Otherwise, uses run_command_fast_fail (which adapts to container environments)
  • When options.check_status is true and exit code != 0, returns DeviceError::CommandFailed