--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

View File

@@ -38,6 +38,8 @@ humantime = "2.0.0"
once_cell = { workspace = true }
listenfd = "1.0.0"
wat = { workspace = true }
serde = "1.0.94"
serde_json = "1.0.26"
[target.'cfg(unix)'.dependencies]
rustix = { workspace = true, features = ["mm", "param"] }