MCPcopy Create free account
hub / github.com/clawshell/clawshell / run_openclaw_raw

Function run_openclaw_raw

src/openclaw_cli.rs:562–592  ·  view source on GitHub ↗
(
    runner: &mut R,
    args: Vec<String>,
    approval_mode: OpenclawApprovalMode,
)

Source from the content-addressed store, hash-verified

560}
561
562fn run_openclaw_raw<R: OpenclawRunner>(
563 runner: &mut R,
564 args: Vec<String>,
565 approval_mode: OpenclawApprovalMode,
566) -> Result<OpenclawCommandOutput, Box<dyn Error>> {
567 let display_args = args.join(" ");
568 #[cfg(test)]
569 let _ = approval_mode;
570 #[cfg(not(test))]
571 {
572 if matches!(approval_mode, OpenclawApprovalMode::PromptUser) {
573 let approval_message = if is_gateway_reload_mode_toggle_command(&args) {
574 format!(
575 "Approve running `openclaw {display_args}` to work around issue {OPENCLAW_GATEWAY_RELOAD_WORKAROUND_ISSUE_URL}?"
576 )
577 } else {
578 format!("Approve running `openclaw {display_args}`?")
579 };
580 let approved =
581 crate::tui::prompt_confirm_compact(&approval_message, true).map_err(|error| {
582 format!("Failed to ask approval for `openclaw {display_args}`: {error}")
583 })?;
584 if !approved {
585 return Err(format!("Command not approved: `openclaw {display_args}`").into());
586 }
587 }
588 }
589 runner.run(&args).map_err(|error| -> Box<dyn Error> {
590 format!("Failed to run `openclaw {display_args}`: {error}").into()
591 })
592}
593
594#[cfg(not(test))]
595fn is_gateway_reload_mode_toggle_command(args: &[String]) -> bool {

Callers 3

run_openclaw_commandFunction · 0.85
run_openclaw_checkedFunction · 0.85

Calls 3

prompt_confirm_compactFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected