feat(formatters): add formatter for the 'custom' module
This commit is contained in:
@@ -22,6 +22,7 @@ pub const formatters = [_]*const fn (allocator: std.mem.Allocator, key: []const
|
|||||||
&getFormattedNetInfo,
|
&getFormattedNetInfo,
|
||||||
&getFormattedTerminalNameInfo,
|
&getFormattedTerminalNameInfo,
|
||||||
&getFormattedLocaleInfo,
|
&getFormattedLocaleInfo,
|
||||||
|
&getFormattedCustom,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const default_formatters = [_]*const fn (allocator: std.mem.Allocator) anyerror!Result{
|
pub const default_formatters = [_]*const fn (allocator: std.mem.Allocator) anyerror!Result{
|
||||||
@@ -207,3 +208,7 @@ pub fn getFormattedNetInfo(allocator: std.mem.Allocator, key: []const u8, key_co
|
|||||||
|
|
||||||
return Result{ .string_arraylist = formatted_net_info_list };
|
return Result{ .string_arraylist = formatted_net_info_list };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn getFormattedCustom(allocator: std.mem.Allocator, key: []const u8, key_color: []const u8) !Result {
|
||||||
|
return Result{ .string = try std.fmt.allocPrint(allocator, "{s}{s}{s}", .{ key_color, key, ascii.Reset }) };
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user