--json option for wasmtime settings command (#5411)

* - Added `--json` flag to settings command
 - Refactored gathering of data into a `Settings` struct which can be used in both human/machine readable paths
 - Split out human readable output to another function, it produces exactly the same result as before

* Outputting JSON by hand formatting it. This approach has the advantage of not needing any extra dependencies (i.e.serde), but is obviously a bit ugly.

* Rewritten JSON serialization to use serde

* Commenting and formatting

* Applied rustfmt

* Reduced version of serde and serde_json to fix cargo vet errors

* Updated cargo.lock to fix cargo vet errors
This commit is contained in:
Martin Evans
2022-12-12 15:32:23 +00:00
committed by GitHub
parent 8035945502
commit 8f23e5a66f
3 changed files with 135 additions and 42 deletions

2
Cargo.lock generated
View File

@@ -3475,6 +3475,8 @@ dependencies = [
"once_cell",
"rayon",
"rustix",
"serde",
"serde_json",
"target-lexicon",
"tempfile",
"test-programs",