Skip to content

Commit 6801fe3

Browse files
committed
Doc: update schema for percent type config
1 parent 1c41c6c commit 6801fe3

File tree

2 files changed

+51
-5
lines changed

2 files changed

+51
-5
lines changed

doc/json_schema.json

+33-5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,35 @@
3434
"description": "Output color of the module. Left empty to use `display.color.output`",
3535
"$ref": "#/$defs/colors"
3636
},
37+
"percentType": {
38+
"description": "Set the percentage output type",
39+
"oneOf": [
40+
{
41+
"type": "number",
42+
"description": "1 for percentage number, 2 for multi-color bar, 3 for both, 6 for bar only, 9 for colored number, 10 for monochrome bar",
43+
"minimum": 0,
44+
"maximum": 255,
45+
"default": 9
46+
},
47+
{
48+
"type": "array",
49+
"description": "array of string flags",
50+
"items": {
51+
"enum": [
52+
"num",
53+
"bar",
54+
"hide-others",
55+
"num-color",
56+
"bar-monochrome"
57+
]
58+
},
59+
"default": [
60+
"num",
61+
"num-color"
62+
]
63+
}
64+
]
65+
},
3766
"percent": {
3867
"description": "Threshold of percentage colors",
3968
"type": "object",
@@ -50,6 +79,9 @@
5079
"minimum": 0,
5180
"maximum": 100,
5281
"description": "Value greater than green and less then yellow will be shown in yellow.\nValue greater than yellow will be shown in red"
82+
},
83+
"type": {
84+
"$ref": "#/$defs/percentType"
5385
}
5486
}
5587
},
@@ -576,11 +608,7 @@
576608
"description": "Set how a percentage value should be displayed",
577609
"properties": {
578610
"type": {
579-
"type": "number",
580-
"description": "Set the percentage output type. 1 for percentage number, 2 for multi-color bar, 3 for both, 6 for bar only, 9 for colored number, 10 for monochrome bar",
581-
"minimum": 0,
582-
"maximum": 255,
583-
"default": 9
611+
"$ref": "#/$defs/percentType"
584612
},
585613
"ndigits": {
586614
"type": "number",

src/data/help.json

+18
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,24 @@
16021602
},
16031603
"pseudo": true
16041604
},
1605+
{
1606+
"long": "<module>-percent-type",
1607+
"desc": "Set the percentage output type",
1608+
"remark": [
1609+
"0 for use global `--percent-type` value",
1610+
"1 for percentage number",
1611+
"2 for multi-color bar",
1612+
"3 for both",
1613+
"6 for bar only",
1614+
"9 for colored number",
1615+
"10 for monochrome bar"
1616+
],
1617+
"arg": {
1618+
"type": "num",
1619+
"default": 0
1620+
},
1621+
"pseudo": true
1622+
},
16051623
{
16061624
"long": "<module>-temp-green",
16071625
"desc": [

0 commit comments

Comments
 (0)