mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-07-10 08:17:48 -06:00
🔨 Add args to schema.py
This commit is contained in:
parent
0100b7be4d
commit
ce26fccc3e
1 changed files with 30 additions and 15 deletions
|
@ -382,11 +382,26 @@ def main():
|
|||
schema = None
|
||||
|
||||
if schema:
|
||||
|
||||
# Get the first command line argument
|
||||
import sys
|
||||
if len(sys.argv) > 1:
|
||||
arg = sys.argv[1]
|
||||
else:
|
||||
arg = 'some'
|
||||
|
||||
# JSON schema
|
||||
if arg in ['some', 'json', 'jsons']:
|
||||
print("Generating JSON ...")
|
||||
dump_json(schema, Path('schema.json'))
|
||||
|
||||
# JSON schema (wildcard names)
|
||||
if arg in ['group', 'jsons']:
|
||||
group_options(schema)
|
||||
dump_json(schema, Path('schema_grouped.json'))
|
||||
|
||||
# YAML
|
||||
if arg in ['some', 'yml', 'yaml']:
|
||||
try:
|
||||
import yaml
|
||||
except ImportError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue