pub async fn execute(
cmd_context: ExecutionContext<'_>,
process_group_id: &mut Option<i32>,
args: Vec<CommandArg>,
use_functions: bool,
path_dirs: Option<Vec<String>>,
) -> Result<ExecutionSpawnResult, Error>Expand description
Executes a simple command.
The command may be a builtin, a shell function, or an externally executed command. This function’s implementation is responsible for dispatching it appropriately according to the context provided.
§Arguments
cmd_context- The context in which the command is being executed.process_group_id- The process group ID to use for externally executed commands. This may be modified if a new process group is created.args- The arguments to the command.use_functions- If true, the command name will be checked against shell functions; if not, shell functions will not be consulted.path_dirs- If provided, these directories will be searched for external commands; if not provided, the default search logic will be used.