feat: add getters

This commit is contained in:
itsscb 2025-05-04 20:31:57 +02:00
parent a2a9be299b
commit 2a358b61a2

View File

@ -27,6 +27,27 @@ impl Script {
&self.path &self.path
} }
pub fn parameters(&self) -> &Vec<Parameter> {
&self.parameters
}
pub fn default_parameter_set(&self) -> Option<&str> {
self.default_parameter_set.as_ref().map(|x| x as _)
}
pub fn help_uri(&self) -> Option<&str> {
self.help_uri.as_ref().map(|x| x as _)
}
pub fn supports_paging(&self) -> Option<&str> {
self.supports_paging.as_ref().map(|x| x as _)
}
pub fn supports_should_process(&self) -> Option<bool> {
self.supports_should_process
}
pub fn positional_binding(&self) -> Option<bool> {
self.positional_binding
}
pub fn from_file<P: AsRef<str>>(path: P) -> Result<Self, String> { pub fn from_file<P: AsRef<str>>(path: P) -> Result<Self, String> {
let func = get_parse_function(); let func = get_parse_function();