ManifestFormat,
MkosiArgs,
MkosiConfig,
+ MkosiJsonEncoder,
OutputFormat,
SecureBootSignTool,
Verb,
return bump_image_version()
if args.verb == Verb.summary:
- text = ""
-
- for config in presets:
- text += f"{summary(config)}\n"
+ if args.json:
+ text = json.dumps(
+ {"Presets": [p.to_dict() for p in presets]},
+ cls=MkosiJsonEncoder,
+ indent=4,
+ sort_keys=True
+ )
+ else:
+ text = "\n".join(summary(p) for p in presets)
page(text, args.pager)
return
genkey_common_name: str
auto_bump: bool
doc_format: DocFormat
+ json: bool
@classmethod
def default(cls) -> "MkosiArgs":
default=DocFormat.auto,
type=DocFormat,
)
+ parser.add_argument(
+ "--json",
+ help="Show summary as JSON",
+ action="store_true",
+ default=False,
+ )
# These can be removed once mkosi v15 is available in LTS distros and compatibility with <= v14
# is no longer needed in build infrastructure (e.g.: OBS).
parser.add_argument(
the default, will try all methods in the order `man`, `pandoc`, `markdown`,
`system`.
+`--json`
+
+: Show the summary output as JSON-SEQ.
+
## Supported output formats
The following output formats are supported:
"Force": 9001,
"GenkeyCommonName": "test",
"GenkeyValidDays": "100",
+ "Json": false,
"Pager": true,
"Verb": "build"
}}
force = 9001,
genkey_common_name = "test",
genkey_valid_days = "100",
+ json = False,
pager = True,
verb = Verb.build,
)