feat(config): add username_hostname_color field and getUsernameHostname function
This commit is contained in:
@@ -10,6 +10,7 @@ pub const Module = struct {
|
||||
|
||||
pub const Config = struct {
|
||||
ascii_abs_path: ?[]u8 = null,
|
||||
username_hostname_color: ?[]u8 = null,
|
||||
modules: []Module,
|
||||
};
|
||||
|
||||
@@ -36,6 +37,12 @@ pub fn getAsciiPath(config: ?std.json.Parsed(Config)) ?[]u8 {
|
||||
} else return null;
|
||||
}
|
||||
|
||||
pub fn getUsernameHostnameColor(config: ?std.json.Parsed(Config)) ?[]u8 {
|
||||
if (config) |c| {
|
||||
return c.value.username_hostname_color;
|
||||
} else return null;
|
||||
}
|
||||
|
||||
pub fn getModulesTypes(allocator: std.mem.Allocator, config: ?std.json.Parsed(Config)) !std.array_list.Managed(ModuleType) {
|
||||
var modules_list = std.array_list.Managed(ModuleType).init(allocator);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user