jq: add object keys color

This commit is contained in:
sudosubin 2024-06-08 22:34:29 +09:00
parent a7117efb37
commit e643370596
No known key found for this signature in database
GPG key ID: 68971E6A5D6DE3D6

View file

@ -22,6 +22,7 @@ let
strings = colorType; strings = colorType;
arrays = colorType; arrays = colorType;
objects = colorType; objects = colorType;
objectKeys = colorType;
}; };
}; };
@ -41,19 +42,20 @@ in {
description = '' description = ''
The colors used in colored JSON output. The colors used in colored JSON output.
See the [Colors section](https://jqlang.github.io/jq/manual/#Colors) See the [Colors section](https://jqlang.github.io/jq/manual/#colors)
of the jq manual. of the jq manual.
''; '';
example = literalExpression '' example = literalExpression ''
{ {
null = "1;30"; null = "1;30";
false = "0;31"; false = "0;31";
true = "0;32"; true = "0;32";
numbers = "0;36"; numbers = "0;36";
strings = "0;33"; strings = "0;33";
arrays = "1;35"; arrays = "1;35";
objects = "1;37"; objects = "1;37";
objectKeys = "1;34";
} }
''; '';
@ -65,6 +67,7 @@ in {
strings = "0;32"; strings = "0;32";
arrays = "1;37"; arrays = "1;37";
objects = "1;37"; objects = "1;37";
objectKeys = "1;34";
}; };
type = colorsType; type = colorsType;
@ -78,7 +81,7 @@ in {
home.sessionVariables = let c = cfg.colors; home.sessionVariables = let c = cfg.colors;
in { in {
JQ_COLORS = JQ_COLORS =
"${c.null}:${c.false}:${c.true}:${c.numbers}:${c.strings}:${c.arrays}:${c.objects}"; "${c.null}:${c.false}:${c.true}:${c.numbers}:${c.strings}:${c.arrays}:${c.objects}:${c.objectKeys}";
}; };
}; };
} }