use crate::compsys::ported::shared::dispatch_action_command;
use crate::ported::zle::complete::bin_compset;
use crate::ported::zsh_h::{options, MAX_OPS};
fn make_ops() -> options {
options {
ind: [0u8; MAX_OPS],
args: Vec::new(),
argscount: 0,
argsalloc: 0,
}
}
pub fn _parameter() -> i32 {
let _fn_scope = crate::compsys::ported::shared::FnScope::enter("_parameter");
if bin_compset(
"compset",
&["-P".to_string(), "*:".to_string()],
&make_ops(),
0,
) == 0
{
return dispatch_action_command("_history_modifiers", &["p".to_string()], 4);
}
dispatch_action_command("_parameters", &["-e".to_string()], 8)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn unresolvable_parameters_reports_command_not_found() {
let _g = crate::test_util::global_state_lock();
assert_eq!(_parameter(), 127);
}
}