Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

settingFromEnvironment

Public Function
std.zig.Color.settingFromEnvironment
pub fn settingFromEnvironment(environ_map: *const std.process.Environ.Map) Color

Determine the preference for color or no color based on the NO_COLOR and CLICOLOR_FORCE environment variables. Color is always disabled on WASI per https://github.com/WebAssembly/WASI/issues/162

Params

File

zig.zig:82
82
83
84
85
86
87
88
89
    pub fn settingFromEnvironment(environ_map: *const std.process.Environ.Map) Color {
        return if (builtin.os.tag == .wasi or EnvVar.NO_COLOR.isSet(environ_map))
            .off
        else if (EnvVar.CLICOLOR_FORCE.isSet(environ_map))
            .on
        else
            .auto;
    }