Skip to main content

resolve_mode

Function resolve_mode 

Source
pub fn resolve_mode(
    parsed: &Args,
    stdin_is_tty: bool,
    stdout_is_tty: bool,
) -> RunMode
Expand description

Resolve the effective output Mode. Mirrors TS resolveAppMode: rpc→rpc, json→json, print or piped-stdin/redirected-stdout→print, else interactive. Here stdin_is_tty/stdout_is_tty come from std::io::IsTerminal.