1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Port of `_assign` from `Completion/Zsh/Context/_assign`.
//!
//! Full upstream body (3 lines verbatim):
//! ```text
//! sh:1 #compdef -assign-parameter-
//! sh:2
//! sh:3 _parameters -g "^*readonly*" -S ''
//! ```
//!
//! Delegates to `_parameters` (sibling shell fn outside the engine
//! cluster) via `exec_hooks::dispatch_function_call`. Returns 1
//! when no executor is wired.
use crate::ported::exec_hooks::dispatch_function_call;
/// `_assign` — `-assign-parameter-` context completion: list
/// writable (non-readonly) parameters with no suffix.
pub fn _assign() -> i32 {
dispatch_function_call(
"_parameters",
&[
"-g".to_string(),
"^*readonly*".to_string(),
"-S".to_string(),
"".to_string(),
],
)
.unwrap_or(1)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn returns_one_without_executor() {
let _g = crate::test_util::global_state_lock();
assert_eq!(_assign(), 1);
}
}