use crate::compsys::ported::shared::dispatch_action_command;
use crate::ported::zsh_h::{isset, AUTOCD};
pub fn _autocd() -> i32 {
let _fn_scope = crate::compsys::ported::shared::FnScope::enter("_autocd");
let ret = dispatch_action_command("_command_names", &[], 3);
if isset(AUTOCD) {
if dispatch_action_command("_cd", &[], 5) == 0 {
0
} else {
ret
}
} else {
ret
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn returns_command_names_status_when_autocd_off() {
let _g = crate::test_util::global_state_lock();
let _r = _autocd();
}
}