use crate::Execute;
use alloc::{
borrow::ToOwned,
collections::btree_map::BTreeMap,
string::String,
vec::{self, Vec},
};
use bon::Builder;
pub trait Runner<T, E>: Execute<T, E> {}
#[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, Builder)]
#[builder(derive(Debug), on(String, into))]
pub struct RunnerOptions {
#[builder(field)]
pub other: Vec<String>,
#[builder(field)]
pub define: BTreeMap<String, String>,
}
impl<S: runner_options_builder::State> RunnerOptionsBuilder<S> {
pub fn other(mut self, flag: impl Into<String>) -> Self {
self.other.push(flag.into());
self
}
pub fn maybe_other(mut self, flag: Option<impl Into<String>>) -> Self {
if let Some(flag) = flag {
self.other.push(flag.into());
}
self
}
pub fn define(mut self, key: impl Into<String>, val: impl Into<String>) -> Self {
self.define.insert(key.into(), val.into());
self
}
}