split_chained_commands

Function split_chained_commands 

Source
pub fn split_chained_commands(command: &str) -> Vec<&str>
Expand description

Split command on &&, ||, and ; to handle chained commands.

Splits on the earliest delimiter found in the string. This is a simple split that doesn’t handle quoted delimiters.

§Examples

use mi6_core::context::github::split_chained_commands;

let parts = split_chained_commands("echo foo && git checkout main");
assert_eq!(parts, vec!["echo foo", "git checkout main"]);

let parts = split_chained_commands("git status; git pull || echo failed");
assert_eq!(parts, vec!["git status", "git pull", "echo failed"]);