Skip to content

Commit

Permalink
feat: make parseWhole available only for "options"
Browse files Browse the repository at this point in the history
Make field parseWhole in config available only for section "options"

Closes #121
  • Loading branch information
ifedchankau committed Aug 6, 2018
1 parent 8d698ea commit 86d0181
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 32 deletions.
6 changes: 2 additions & 4 deletions src/template/configDefault.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
":",
"\n",
":\n"
],
"parseWhole": false
]
},
"examples": {
"names": [
Expand All @@ -30,8 +29,7 @@
":",
"\n",
":\n"
],
"parseWhole": false
]
}
},
"delimiter": "=",
Expand Down
73 changes: 45 additions & 28 deletions src/template/configSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,31 @@
"title": "Array",
"description": "Default array of strings",
"type":"array",
"items": [
"items": {
"type": "string"
}
},
"section:names": {
"title": "Names",
"description": "Names of section",
"oneOf": [
{
"$ref": "#/definitions/default:string"
},
{
"$ref": "#/definitions/default:array"
}
]
},
"section:postfix": {
"title": "Postfixes",
"description": "Postfixes, that will be added to a names if no names found",
"oneOf": [
{
"$ref": "#/definitions/default:string"
},
{
"$ref": "#/definitions/default:string"
"$ref": "#/definitions/default:array"
}
]
},
Expand All @@ -44,44 +66,39 @@
"type": "object",
"properties": {
"options": {
"$ref": "#/definitions/section:default"
"$ref": "#/definitions/section:options"
},
"usage": {
"$ref": "#/definitions/section:default"
"$ref": "#/definitions/section:optional"
},
"examples": {
"$ref": "#/definitions/section:default"
"$ref": "#/definitions/section:optional"
}
},
"additionalProperties": false
},
"section:optional": {
"title": "Optional section",
"description": "Optional section of config",
"properties": {
"names": {
"$ref": "#/definitions/section:names"
},
"postfix": {
"$ref": "#/definitions/section:postfix"
}
},
"additionalProperties": false
},
"section:default": {
"title": "Section",
"description": "Section of help",
"section:options": {
"title": "Section Options",
"description": "Section Options of config",
"properties": {
"names": {
"title": "Names",
"description": "Names of section",
"oneOf": [
{
"$ref": "#/definitions/default:string"
},
{
"$ref": "#/definitions/default:array"
}
]
"$ref": "#/definitions/section:names"
},
"postfix": {
"title": "Postfixes",
"description": "Postfixes, that will be added to a names if no names found",
"oneOf": [
{
"$ref": "#/definitions/default:string"
},
{
"$ref": "#/definitions/default:array"
}
]
"$ref": "#/definitions/section:postfix"
},
"parseWhole": {
"title": "Parse whole help",
Expand Down

0 comments on commit 86d0181

Please sign in to comment.